Skip to content

Commit

Permalink
feat: adding new lambda of user threads GSI (#325)
Browse files Browse the repository at this point in the history
* 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: 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

---------

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]>
  • Loading branch information
6 people authored Sep 18, 2023
1 parent 0ba9c38 commit d2c66b6
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 82 deletions.
31 changes: 24 additions & 7 deletions lib/constructs/business/rest-api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ export class ForumThreadsApiService extends RestApiService {
const root = scope.apiEndpoint.root.addResource('forum');
const boardResource = root.addResource('{board_id}');
const threadResource = boardResource.addResource('{thread_id}');
const userResource = root.addResource('user');

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

const optionsUserThreads = userResource.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 Down Expand Up @@ -786,8 +799,8 @@ export class ForumThreadsApiService extends RestApiService {
forumThreadsFunctions.getAllFunction,
{ proxy: true },
);
const getBoardIntegration = new apigw.LambdaIntegration(
forumThreadsFunctions.getBoardFunction,
const getUserIntegration = new apigw.LambdaIntegration(
forumThreadsFunctions.getUserFunction,
{ proxy: true },
);
const getThreadIntegration = new apigw.LambdaIntegration(
Expand Down Expand Up @@ -823,18 +836,19 @@ export class ForumThreadsApiService extends RestApiService {
},
);

const getBoardForumThreads = boardResource.addMethod(
const getUserForumThreads = userResource.addMethod(
apigw2.HttpMethod.GET,
getBoardIntegration,
getUserIntegration,
{
operationName: 'GetBoardThreads',
operationName: 'GetUserThreads',
methodResponses: [
{
statusCode: '200',
responseModels: { ['application/json']: getRespModel },
responseModels: { ['application/json']: apigw.Model.EMPTY_MODEL },
responseParameters: lambdaRespParams,
},
],
authorizer: props.authorizer,
requestValidator: props.validator,
},
);
Expand Down Expand Up @@ -910,8 +924,11 @@ export class ForumThreadsApiService extends RestApiService {
[apigw2.HttpMethod.GET]: getAllForumThreads,
[apigw2.HttpMethod.OPTIONS]: optionsForumHome,
},
'/forum/{uid}': {
[apigw2.HttpMethod.GET]: getUserForumThreads,
[apigw2.HttpMethod.OPTIONS]: optionsUserThreads,
},
'/forum/{board_id}': {
[apigw2.HttpMethod.GET]: getBoardForumThreads,
[apigw2.HttpMethod.POST]: postForumThreads,
[apigw2.HttpMethod.OPTIONS]: optionsForumBoards,
},
Expand Down
12 changes: 6 additions & 6 deletions lib/constructs/common/lambda-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ export class SyllabusUpdateFunction extends Construct {

export class ForumThreadFunctions extends Construct {
readonly getAllFunction: lambda.Function;
readonly getBoardFunction: lambda.Function;
readonly getUserFunction: lambda.Function;
readonly getSingleFunction: lambda.Function;
readonly postFunction: lambda.Function;
readonly patchFunction: lambda.Function;
Expand Down Expand Up @@ -559,13 +559,13 @@ export class ForumThreadFunctions extends Construct {
},
);

this.getBoardFunction = new lambda_py.PythonFunction(
this.getUserFunction = new lambda_py.PythonFunction(
this,
'get-board-threads',
'get-user-threads',
{
entry: 'src/lambda/get-board-threads',
description: 'Get forum threads from the database.',
functionName: 'get-board-threads',
entry: 'src/lambda/get-user-threads',
description: "Get user's threads from the database.",
functionName: 'get-user-threads',
logRetention: logs.RetentionDays.ONE_MONTH,
memorySize: 128,
role: dynamoDBReadRole,
Expand Down
16 changes: 8 additions & 8 deletions lib/constructs/persistence/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@ export class DynamoDatabase extends Construct {
},
billingMode: dynamodb.BillingMode.PROVISIONED,
encryption: dynamodb.TableEncryption.DEFAULT,
removalPolicy: RemovalPolicy.DESTROY,
removalPolicy: RemovalPolicy.RETAIN,
sortKey: { name: 'thread_id', type: dynamodb.AttributeType.STRING },
tableName: 'forum-threads',
readCapacity: 15,
writeCapacity: 15,
pointInTimeRecovery: true,
},
);
this.tables[Collection.THREAD].addGlobalSecondaryIndex({
indexName: 'UidbyThreadIDIndex',
partitionKey: { name: 'uid', type: dynamodb.AttributeType.STRING },
sortKey: { name: 'thread_id', type: dynamodb.AttributeType.STRING },
projectionType: dynamodb.ProjectionType.ALL,
});

// this.tables[Collection.THREAD].addLocalSecondaryIndex({
// indexName: 'GroupIndex',
Expand All @@ -113,13 +119,6 @@ export class DynamoDatabase extends Construct {
// projectionType: dynamodb.ProjectionType.ALL,
// });

// this.tables[Collection.THREAD].addGlobalSecondaryIndex({
// indexName: "UidbyCreated_at",
// partitionKey: { name: "uid", type: dynamodb.AttributeType.STRING },
// sortKey: { name: "created_at", type: dynamodb.AttributeType.NUMBER },
// projectionType: dynamodb.ProjectionType.ALL,
// });

this.tables[Collection.COMMENT] = new dynamodb.Table(
this,
'dynamodb-comment-table',
Expand All @@ -140,3 +139,4 @@ export class DynamoDatabase extends Construct {
);
}
}
//comment to prevent empty thread
2 changes: 1 addition & 1 deletion src/lambda/get-all-threads/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_all_threads(uid, index, num, school, tags, board_id):
response = table.query(KeyConditionExpression=Key(
"board_id").eq(board_id), ScanIndexForward=False)
else:
response = table.scan()
response = table.scan(ConsistentRead=False)

items = response['Items']

Expand Down
59 changes: 0 additions & 59 deletions src/lambda/get-board-threads/index.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/lambda/get-comments/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@resp_handler
def get_comments(thread_id, uid=""):
results = table.query(KeyConditionExpression=Key(
"thread_id").eq(thread_id), ScanIndexForward=False)["Items"]
"thread_id").eq(thread_id), ScanIndexForward=True)["Items"]
for r in results:
r["mod"] = False
if r["uid"] == uid:
Expand Down
51 changes: 51 additions & 0 deletions src/lambda/get-user-threads/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from boto3.dynamodb.conditions import Key, Attr
import boto3
from datetime import datetime
from utils import JsonPayloadBuilder, table, resp_handler


@resp_handler
def get_user_threads(uid=""):

# Query the GSI
response = table.query(
IndexName='UidbyThreadIDIndex', # Replace with your actual GSI name
KeyConditionExpression=Key('uid').eq(uid),
FilterExpression=Attr('new_comment').eq(True),
ScanIndexForward=False # Sorting by thread_id in descending order
)

results = response['Items']

# Count the threads with new comments
new_comment_count = len(results)

# Collect the thread_ids
thread_ids = [item['thread_id'] for item in results]

# Determine the response data based on new_comment_count
response_data = {
'thread_ids': thread_ids,
'new_comment_count': new_comment_count,
'new_comment_flag': new_comment_count >= 1
}

body = JsonPayloadBuilder().add_status(True)\
.add_data(response_data)\
.add_message('').compile()

return body


def handler(event, context):

print(event)

params = {
"uid": event['requestContext']['authorizer']['claims']['sub']
}

# index = event['queryStringParameters'].get('index', '0')
# num = event['queryStringParameters'].get('num', '10')

return get_user_threads(**params)
File renamed without changes.

0 comments on commit d2c66b6

Please sign in to comment.