@aurora-interactive/sensei-productivity 1.1.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -14
- package/dist/commonjs/funcs/categories-create.d.ts +1 -1
- package/dist/commonjs/funcs/categories-create.d.ts.map +1 -1
- package/dist/commonjs/funcs/categories-create.js +2 -3
- package/dist/commonjs/funcs/categories-create.js.map +1 -1
- package/dist/commonjs/funcs/categories-delete.js +2 -2
- package/dist/commonjs/funcs/categories-delete.js.map +1 -1
- package/dist/commonjs/funcs/categories-get-all.d.ts +1 -1
- package/dist/commonjs/funcs/categories-get-all.d.ts.map +1 -1
- package/dist/commonjs/funcs/categories-get-all.js +2 -3
- package/dist/commonjs/funcs/categories-get-all.js.map +1 -1
- package/dist/commonjs/funcs/categories-update.d.ts +1 -1
- package/dist/commonjs/funcs/categories-update.d.ts.map +1 -1
- package/dist/commonjs/funcs/categories-update.js +2 -3
- package/dist/commonjs/funcs/categories-update.js.map +1 -1
- package/dist/commonjs/funcs/schools-get-all.js +2 -2
- package/dist/commonjs/funcs/schools-get-all.js.map +1 -1
- package/dist/commonjs/funcs/schools-get.d.ts +1 -1
- package/dist/commonjs/funcs/schools-get.d.ts.map +1 -1
- package/dist/commonjs/funcs/schools-get.js +2 -3
- package/dist/commonjs/funcs/schools-get.js.map +1 -1
- package/dist/commonjs/funcs/{user-activities-create.d.ts → users-activities-create.d.ts} +2 -2
- package/dist/commonjs/funcs/users-activities-create.d.ts.map +1 -0
- package/dist/commonjs/funcs/{user-activities-create.js → users-activities-create.js} +5 -6
- package/dist/commonjs/funcs/users-activities-create.js.map +1 -0
- package/dist/commonjs/funcs/{user-activities-delete.d.ts → users-activities-delete.d.ts} +2 -2
- package/dist/commonjs/funcs/users-activities-delete.d.ts.map +1 -0
- package/dist/commonjs/funcs/{user-activities-delete.js → users-activities-delete.js} +5 -5
- package/dist/commonjs/funcs/users-activities-delete.js.map +1 -0
- package/dist/{esm/funcs/user-activities-get-all-of-user.d.ts → commonjs/funcs/users-activities-get-all-of-user.d.ts} +2 -2
- package/dist/commonjs/funcs/users-activities-get-all-of-user.d.ts.map +1 -0
- package/dist/commonjs/funcs/{user-activities-get-all-of-user.js → users-activities-get-all-of-user.js} +5 -6
- package/dist/commonjs/funcs/users-activities-get-all-of-user.js.map +1 -0
- package/dist/{esm/funcs/user-activities-get.d.ts → commonjs/funcs/users-activities-get.d.ts} +2 -2
- package/dist/commonjs/funcs/users-activities-get.d.ts.map +1 -0
- package/dist/commonjs/funcs/{user-activities-get.js → users-activities-get.js} +5 -6
- package/dist/commonjs/funcs/users-activities-get.js.map +1 -0
- package/dist/{esm/funcs/user-activities-me.d.ts → commonjs/funcs/users-activities-me.d.ts} +2 -2
- package/dist/commonjs/funcs/{user-activities-get.d.ts.map → users-activities-me.d.ts.map} +1 -1
- package/dist/commonjs/funcs/{user-activities-me.js → users-activities-me.js} +5 -6
- package/dist/commonjs/funcs/users-activities-me.js.map +1 -0
- package/dist/{esm/funcs/user-activities-update.d.ts → commonjs/funcs/users-activities-update.d.ts} +2 -2
- package/dist/commonjs/funcs/users-activities-update.d.ts.map +1 -0
- package/dist/commonjs/funcs/{user-activities-update.js → users-activities-update.js} +5 -6
- package/dist/commonjs/funcs/users-activities-update.js.map +1 -0
- package/dist/commonjs/funcs/users-delete.js +2 -2
- package/dist/commonjs/funcs/users-delete.js.map +1 -1
- package/dist/commonjs/funcs/users-get.d.ts +1 -1
- package/dist/commonjs/funcs/users-get.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-get.js +2 -3
- package/dist/commonjs/funcs/users-get.js.map +1 -1
- package/dist/commonjs/funcs/users-login.d.ts +1 -1
- package/dist/commonjs/funcs/users-login.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-login.js +2 -3
- package/dist/commonjs/funcs/users-login.js.map +1 -1
- package/dist/commonjs/funcs/users-me.d.ts +1 -1
- package/dist/commonjs/funcs/users-me.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-me.js +2 -3
- package/dist/commonjs/funcs/users-me.js.map +1 -1
- package/dist/commonjs/funcs/users-posts-delete.d.ts +14 -0
- package/dist/commonjs/funcs/{user-activities-me.d.ts.map → users-posts-delete.d.ts.map} +1 -1
- package/dist/commonjs/funcs/users-posts-delete.js +127 -0
- package/dist/commonjs/funcs/users-posts-delete.js.map +1 -0
- package/dist/commonjs/funcs/users-posts-feed.d.ts +14 -0
- package/dist/commonjs/funcs/users-posts-feed.d.ts.map +1 -0
- package/dist/commonjs/funcs/users-posts-feed.js +126 -0
- package/dist/commonjs/funcs/users-posts-feed.js.map +1 -0
- package/dist/commonjs/funcs/users-posts-get-by-post-id.d.ts +14 -0
- package/dist/commonjs/funcs/users-posts-get-by-post-id.d.ts.map +1 -0
- package/dist/commonjs/funcs/users-posts-get-by-post-id.js +127 -0
- package/dist/commonjs/funcs/users-posts-get-by-post-id.js.map +1 -0
- package/dist/commonjs/funcs/users-posts-get-by-user-id.d.ts +14 -0
- package/dist/commonjs/funcs/users-posts-get-by-user-id.d.ts.map +1 -0
- package/dist/commonjs/funcs/users-posts-get-by-user-id.js +127 -0
- package/dist/commonjs/funcs/users-posts-get-by-user-id.js.map +1 -0
- package/dist/commonjs/funcs/users-posts-update.d.ts +14 -0
- package/dist/{esm/funcs/user-activities-me.d.ts.map → commonjs/funcs/users-posts-update.d.ts.map} +1 -1
- package/dist/commonjs/funcs/users-posts-update.js +128 -0
- package/dist/commonjs/funcs/users-posts-update.js.map +1 -0
- package/dist/commonjs/funcs/users-signup.d.ts +1 -1
- package/dist/commonjs/funcs/users-signup.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-signup.js +2 -3
- package/dist/commonjs/funcs/users-signup.js.map +1 -1
- package/dist/commonjs/funcs/users-update.d.ts +1 -1
- package/dist/commonjs/funcs/users-update.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-update.js +2 -3
- package/dist/commonjs/funcs/users-update.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +4 -4
- package/dist/commonjs/lib/config.js +4 -4
- package/dist/commonjs/models/operations/delete-post.d.ts +12 -0
- package/dist/commonjs/models/operations/delete-post.d.ts.map +1 -0
- package/dist/commonjs/models/operations/delete-post.js +49 -0
- package/dist/commonjs/models/operations/delete-post.js.map +1 -0
- package/dist/commonjs/models/operations/get-feed.d.ts +49 -0
- package/dist/commonjs/models/operations/get-feed.d.ts.map +1 -0
- package/dist/commonjs/models/operations/get-feed.js +85 -0
- package/dist/commonjs/models/operations/get-feed.js.map +1 -0
- package/dist/commonjs/models/operations/get-post-by-id.d.ts +38 -0
- package/dist/commonjs/models/operations/get-post-by-id.d.ts.map +1 -0
- package/dist/commonjs/models/operations/get-post-by-id.js +73 -0
- package/dist/commonjs/models/operations/get-post-by-id.js.map +1 -0
- package/dist/commonjs/models/operations/get-user-posts.d.ts +35 -0
- package/dist/commonjs/models/operations/get-user-posts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/get-user-posts.js +73 -0
- package/dist/commonjs/models/operations/get-user-posts.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +5 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +5 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/update-post.d.ts +60 -0
- package/dist/commonjs/models/operations/update-post.d.ts.map +1 -0
- package/dist/commonjs/models/operations/update-post.js +90 -0
- package/dist/commonjs/models/operations/update-post.js.map +1 -0
- package/dist/commonjs/sdk/activities.d.ts +5 -5
- package/dist/commonjs/sdk/activities.d.ts.map +1 -1
- package/dist/commonjs/sdk/activities.js +12 -12
- package/dist/commonjs/sdk/activities.js.map +1 -1
- package/dist/commonjs/sdk/categories.d.ts +3 -3
- package/dist/commonjs/sdk/categories.d.ts.map +1 -1
- package/dist/commonjs/sdk/posts.d.ts +25 -0
- package/dist/commonjs/sdk/posts.d.ts.map +1 -0
- package/dist/commonjs/sdk/posts.js +47 -0
- package/dist/commonjs/sdk/posts.js.map +1 -0
- package/dist/commonjs/sdk/schools.d.ts +1 -1
- package/dist/commonjs/sdk/schools.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +0 -3
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +0 -4
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/users.d.ts +11 -5
- package/dist/commonjs/sdk/users.d.ts.map +1 -1
- package/dist/commonjs/sdk/users.js +8 -0
- package/dist/commonjs/sdk/users.js.map +1 -1
- package/dist/esm/funcs/categories-create.d.ts +1 -1
- package/dist/esm/funcs/categories-create.d.ts.map +1 -1
- package/dist/esm/funcs/categories-create.js +2 -3
- package/dist/esm/funcs/categories-create.js.map +1 -1
- package/dist/esm/funcs/categories-delete.js +2 -2
- package/dist/esm/funcs/categories-delete.js.map +1 -1
- package/dist/esm/funcs/categories-get-all.d.ts +1 -1
- package/dist/esm/funcs/categories-get-all.d.ts.map +1 -1
- package/dist/esm/funcs/categories-get-all.js +2 -3
- package/dist/esm/funcs/categories-get-all.js.map +1 -1
- package/dist/esm/funcs/categories-update.d.ts +1 -1
- package/dist/esm/funcs/categories-update.d.ts.map +1 -1
- package/dist/esm/funcs/categories-update.js +2 -3
- package/dist/esm/funcs/categories-update.js.map +1 -1
- package/dist/esm/funcs/schools-get-all.js +2 -2
- package/dist/esm/funcs/schools-get-all.js.map +1 -1
- package/dist/esm/funcs/schools-get.d.ts +1 -1
- package/dist/esm/funcs/schools-get.d.ts.map +1 -1
- package/dist/esm/funcs/schools-get.js +2 -3
- package/dist/esm/funcs/schools-get.js.map +1 -1
- package/dist/esm/funcs/{user-activities-create.d.ts → users-activities-create.d.ts} +2 -2
- package/dist/esm/funcs/users-activities-create.d.ts.map +1 -0
- package/dist/esm/funcs/{user-activities-create.js → users-activities-create.js} +4 -5
- package/dist/esm/funcs/users-activities-create.js.map +1 -0
- package/dist/esm/funcs/{user-activities-delete.d.ts → users-activities-delete.d.ts} +2 -2
- package/dist/esm/funcs/users-activities-delete.d.ts.map +1 -0
- package/dist/esm/funcs/{user-activities-delete.js → users-activities-delete.js} +4 -4
- package/dist/esm/funcs/users-activities-delete.js.map +1 -0
- package/dist/{commonjs/funcs/user-activities-get-all-of-user.d.ts → esm/funcs/users-activities-get-all-of-user.d.ts} +2 -2
- package/dist/esm/funcs/users-activities-get-all-of-user.d.ts.map +1 -0
- package/dist/esm/funcs/{user-activities-get-all-of-user.js → users-activities-get-all-of-user.js} +4 -5
- package/dist/esm/funcs/users-activities-get-all-of-user.js.map +1 -0
- package/dist/{commonjs/funcs/user-activities-get.d.ts → esm/funcs/users-activities-get.d.ts} +2 -2
- package/dist/esm/funcs/users-activities-get.d.ts.map +1 -0
- package/dist/esm/funcs/{user-activities-get.js → users-activities-get.js} +4 -5
- package/dist/esm/funcs/users-activities-get.js.map +1 -0
- package/dist/{commonjs/funcs/user-activities-me.d.ts → esm/funcs/users-activities-me.d.ts} +2 -2
- package/dist/esm/funcs/{user-activities-get.d.ts.map → users-activities-me.d.ts.map} +1 -1
- package/dist/esm/funcs/{user-activities-me.js → users-activities-me.js} +4 -5
- package/dist/esm/funcs/users-activities-me.js.map +1 -0
- package/dist/{commonjs/funcs/user-activities-update.d.ts → esm/funcs/users-activities-update.d.ts} +2 -2
- package/dist/esm/funcs/users-activities-update.d.ts.map +1 -0
- package/dist/esm/funcs/{user-activities-update.js → users-activities-update.js} +4 -5
- package/dist/esm/funcs/users-activities-update.js.map +1 -0
- package/dist/esm/funcs/users-delete.js +2 -2
- package/dist/esm/funcs/users-delete.js.map +1 -1
- package/dist/esm/funcs/users-get.d.ts +1 -1
- package/dist/esm/funcs/users-get.d.ts.map +1 -1
- package/dist/esm/funcs/users-get.js +2 -3
- package/dist/esm/funcs/users-get.js.map +1 -1
- package/dist/esm/funcs/users-login.d.ts +1 -1
- package/dist/esm/funcs/users-login.d.ts.map +1 -1
- package/dist/esm/funcs/users-login.js +2 -3
- package/dist/esm/funcs/users-login.js.map +1 -1
- package/dist/esm/funcs/users-me.d.ts +1 -1
- package/dist/esm/funcs/users-me.d.ts.map +1 -1
- package/dist/esm/funcs/users-me.js +2 -3
- package/dist/esm/funcs/users-me.js.map +1 -1
- package/dist/esm/funcs/users-posts-delete.d.ts +14 -0
- package/dist/esm/funcs/users-posts-delete.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-delete.js +91 -0
- package/dist/esm/funcs/users-posts-delete.js.map +1 -0
- package/dist/esm/funcs/users-posts-feed.d.ts +14 -0
- package/dist/esm/funcs/users-posts-feed.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-feed.js +90 -0
- package/dist/esm/funcs/users-posts-feed.js.map +1 -0
- package/dist/esm/funcs/users-posts-get-by-post-id.d.ts +14 -0
- package/dist/esm/funcs/users-posts-get-by-post-id.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-get-by-post-id.js +91 -0
- package/dist/esm/funcs/users-posts-get-by-post-id.js.map +1 -0
- package/dist/esm/funcs/users-posts-get-by-user-id.d.ts +14 -0
- package/dist/esm/funcs/users-posts-get-by-user-id.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-get-by-user-id.js +91 -0
- package/dist/esm/funcs/users-posts-get-by-user-id.js.map +1 -0
- package/dist/esm/funcs/users-posts-update.d.ts +14 -0
- package/dist/esm/funcs/users-posts-update.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-update.js +92 -0
- package/dist/esm/funcs/users-posts-update.js.map +1 -0
- package/dist/esm/funcs/users-signup.d.ts +1 -1
- package/dist/esm/funcs/users-signup.d.ts.map +1 -1
- package/dist/esm/funcs/users-signup.js +2 -3
- package/dist/esm/funcs/users-signup.js.map +1 -1
- package/dist/esm/funcs/users-update.d.ts +1 -1
- package/dist/esm/funcs/users-update.d.ts.map +1 -1
- package/dist/esm/funcs/users-update.js +2 -3
- package/dist/esm/funcs/users-update.js.map +1 -1
- package/dist/esm/lib/config.d.ts +4 -4
- package/dist/esm/lib/config.js +4 -4
- package/dist/esm/models/operations/delete-post.d.ts +12 -0
- package/dist/esm/models/operations/delete-post.d.ts.map +1 -0
- package/dist/esm/models/operations/delete-post.js +12 -0
- package/dist/esm/models/operations/delete-post.js.map +1 -0
- package/dist/esm/models/operations/get-feed.d.ts +49 -0
- package/dist/esm/models/operations/get-feed.d.ts.map +1 -0
- package/dist/esm/models/operations/get-feed.js +46 -0
- package/dist/esm/models/operations/get-feed.js.map +1 -0
- package/dist/esm/models/operations/get-post-by-id.d.ts +38 -0
- package/dist/esm/models/operations/get-post-by-id.d.ts.map +1 -0
- package/dist/esm/models/operations/get-post-by-id.js +35 -0
- package/dist/esm/models/operations/get-post-by-id.js.map +1 -0
- package/dist/esm/models/operations/get-user-posts.d.ts +35 -0
- package/dist/esm/models/operations/get-user-posts.d.ts.map +1 -0
- package/dist/esm/models/operations/get-user-posts.js +35 -0
- package/dist/esm/models/operations/get-user-posts.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +5 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +5 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/update-post.d.ts +60 -0
- package/dist/esm/models/operations/update-post.d.ts.map +1 -0
- package/dist/esm/models/operations/update-post.js +51 -0
- package/dist/esm/models/operations/update-post.js.map +1 -0
- package/dist/esm/sdk/activities.d.ts +5 -5
- package/dist/esm/sdk/activities.d.ts.map +1 -1
- package/dist/esm/sdk/activities.js +12 -12
- package/dist/esm/sdk/activities.js.map +1 -1
- package/dist/esm/sdk/categories.d.ts +3 -3
- package/dist/esm/sdk/categories.d.ts.map +1 -1
- package/dist/esm/sdk/posts.d.ts +25 -0
- package/dist/esm/sdk/posts.d.ts.map +1 -0
- package/dist/esm/sdk/posts.js +43 -0
- package/dist/esm/sdk/posts.js.map +1 -0
- package/dist/esm/sdk/schools.d.ts +1 -1
- package/dist/esm/sdk/schools.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +0 -3
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +0 -4
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/users.d.ts +11 -5
- package/dist/esm/sdk/users.d.ts.map +1 -1
- package/dist/esm/sdk/users.js +8 -0
- package/dist/esm/sdk/users.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/rest-api/cypress/e2e/activity-post-endpoints.cy.ts +239 -0
- package/rest-api/cypress/e2e/user-activity-endpoints.cy.ts +8 -20
- package/rest-api/cypress/e2e/user-endpoints.cy.ts +3 -3
- package/rest-api/cypress.config.ts +29 -23
- package/rest-api/index.js +13 -7
- package/rest-api/lib/users.js +33 -0
- package/rest-api/routes/ActivityPostFunctions.js +208 -0
- package/rest-api/routes/UserActivityFunctions.js +1 -33
- package/rest-api/routes/UserFunctions.js +30 -24
- package/src/funcs/categories-create.ts +6 -14
- package/src/funcs/categories-delete.ts +2 -3
- package/src/funcs/categories-get-all.ts +6 -14
- package/src/funcs/categories-update.ts +6 -14
- package/src/funcs/schools-get-all.ts +2 -2
- package/src/funcs/schools-get.ts +6 -11
- package/src/funcs/{user-activities-create.ts → users-activities-create.ts} +7 -15
- package/src/funcs/{user-activities-delete.ts → users-activities-delete.ts} +3 -4
- package/src/funcs/{user-activities-get-all-of-user.ts → users-activities-get-all-of-user.ts} +7 -19
- package/src/funcs/{user-activities-get.ts → users-activities-get.ts} +7 -15
- package/src/funcs/{user-activities-me.ts → users-activities-me.ts} +7 -15
- package/src/funcs/{user-activities-update.ts → users-activities-update.ts} +7 -15
- package/src/funcs/users-delete.ts +2 -3
- package/src/funcs/users-get.ts +6 -11
- package/src/funcs/users-login.ts +6 -11
- package/src/funcs/users-me.ts +6 -14
- package/src/funcs/users-posts-delete.ts +174 -0
- package/src/funcs/users-posts-feed.ts +174 -0
- package/src/funcs/users-posts-get-by-post-id.ts +174 -0
- package/src/funcs/users-posts-get-by-user-id.ts +174 -0
- package/src/funcs/users-posts-update.ts +175 -0
- package/src/funcs/users-signup.ts +6 -8
- package/src/funcs/users-update.ts +6 -11
- package/src/lib/config.ts +4 -4
- package/src/models/operations/delete-post.ts +30 -0
- package/src/models/operations/get-feed.ts +110 -0
- package/src/models/operations/get-post-by-id.ts +86 -0
- package/src/models/operations/get-user-posts.ts +83 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/update-post.ts +131 -0
- package/src/sdk/activities.ts +17 -17
- package/src/sdk/categories.ts +3 -3
- package/src/sdk/posts.ts +84 -0
- package/src/sdk/schools.ts +1 -1
- package/src/sdk/sdk.ts +0 -6
- package/src/sdk/users.ts +17 -5
- package/dist/commonjs/funcs/user-activities-create.d.ts.map +0 -1
- package/dist/commonjs/funcs/user-activities-create.js.map +0 -1
- package/dist/commonjs/funcs/user-activities-delete.d.ts.map +0 -1
- package/dist/commonjs/funcs/user-activities-delete.js.map +0 -1
- package/dist/commonjs/funcs/user-activities-get-all-of-user.d.ts.map +0 -1
- package/dist/commonjs/funcs/user-activities-get-all-of-user.js.map +0 -1
- package/dist/commonjs/funcs/user-activities-get.js.map +0 -1
- package/dist/commonjs/funcs/user-activities-me.js.map +0 -1
- package/dist/commonjs/funcs/user-activities-update.d.ts.map +0 -1
- package/dist/commonjs/funcs/user-activities-update.js.map +0 -1
- package/dist/commonjs/sdk/user.d.ts +0 -7
- package/dist/commonjs/sdk/user.d.ts.map +0 -1
- package/dist/commonjs/sdk/user.js +0 -15
- package/dist/commonjs/sdk/user.js.map +0 -1
- package/dist/esm/funcs/user-activities-create.d.ts.map +0 -1
- package/dist/esm/funcs/user-activities-create.js.map +0 -1
- package/dist/esm/funcs/user-activities-delete.d.ts.map +0 -1
- package/dist/esm/funcs/user-activities-delete.js.map +0 -1
- package/dist/esm/funcs/user-activities-get-all-of-user.d.ts.map +0 -1
- package/dist/esm/funcs/user-activities-get-all-of-user.js.map +0 -1
- package/dist/esm/funcs/user-activities-get.js.map +0 -1
- package/dist/esm/funcs/user-activities-me.js.map +0 -1
- package/dist/esm/funcs/user-activities-update.d.ts.map +0 -1
- package/dist/esm/funcs/user-activities-update.js.map +0 -1
- package/dist/esm/sdk/user.d.ts +0 -7
- package/dist/esm/sdk/user.d.ts.map +0 -1
- package/dist/esm/sdk/user.js +0 -11
- package/dist/esm/sdk/user.js.map +0 -1
- package/src/sdk/user.ts +0 -13
|
@@ -8,6 +8,6 @@ export declare class Schools extends ClientSDK {
|
|
|
8
8
|
/**
|
|
9
9
|
* Get a school's details by ID
|
|
10
10
|
*/
|
|
11
|
-
get(request: operations.GetSchoolByIdRequest, options?: RequestOptions): Promise<operations.GetSchoolByIdResponse
|
|
11
|
+
get(request: operations.GetSchoolByIdRequest, options?: RequestOptions): Promise<operations.GetSchoolByIdResponse>;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=schools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schools.d.ts","sourceRoot":"","sources":["../../../src/sdk/schools.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,OAAQ,SAAQ,SAAS;IACpC;;OAEG;IACG,MAAM,CACV,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAOjD;;OAEG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"schools.d.ts","sourceRoot":"","sources":["../../../src/sdk/schools.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,OAAQ,SAAQ,SAAS;IACpC;;OAEG;IACG,MAAM,CACV,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAOjD;;OAEG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,oBAAoB,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC;CAO7C"}
|
package/dist/esm/sdk/sdk.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ClientSDK } from "../lib/sdks.js";
|
|
2
2
|
import { Categories } from "./categories.js";
|
|
3
3
|
import { Schools } from "./schools.js";
|
|
4
|
-
import { User } from "./user.js";
|
|
5
4
|
import { Users } from "./users.js";
|
|
6
5
|
export declare class SenseiProductivity extends ClientSDK {
|
|
7
6
|
private _users?;
|
|
@@ -10,7 +9,5 @@ export declare class SenseiProductivity extends ClientSDK {
|
|
|
10
9
|
get schools(): Schools;
|
|
11
10
|
private _categories?;
|
|
12
11
|
get categories(): Categories;
|
|
13
|
-
private _user?;
|
|
14
|
-
get user(): User;
|
|
15
12
|
}
|
|
16
13
|
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,IAAI,UAAU,IAAI,UAAU,CAE3B;CACF"}
|
package/dist/esm/sdk/sdk.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { ClientSDK } from "../lib/sdks.js";
|
|
5
5
|
import { Categories } from "./categories.js";
|
|
6
6
|
import { Schools } from "./schools.js";
|
|
7
|
-
import { User } from "./user.js";
|
|
8
7
|
import { Users } from "./users.js";
|
|
9
8
|
export class SenseiProductivity extends ClientSDK {
|
|
10
9
|
get users() {
|
|
@@ -16,8 +15,5 @@ export class SenseiProductivity extends ClientSDK {
|
|
|
16
15
|
get categories() {
|
|
17
16
|
return (this._categories ?? (this._categories = new Categories(this._options)));
|
|
18
17
|
}
|
|
19
|
-
get user() {
|
|
20
|
-
return (this._user ?? (this._user = new User(this._options)));
|
|
21
|
-
}
|
|
22
18
|
}
|
|
23
19
|
//# sourceMappingURL=sdk.js.map
|
package/dist/esm/sdk/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAE/C,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACpD,CAAC;IAGD,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACxD,CAAC;IAGD,IAAI,UAAU;QACZ,OAAO,CAAC,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC9D,CAAC;CACF"}
|
package/dist/esm/sdk/users.d.ts
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
2
|
import * as operations from "../models/operations/index.js";
|
|
3
|
+
import { Activities } from "./activities.js";
|
|
4
|
+
import { Posts } from "./posts.js";
|
|
3
5
|
export declare class Users extends ClientSDK {
|
|
6
|
+
private _activities?;
|
|
7
|
+
get activities(): Activities;
|
|
8
|
+
private _posts?;
|
|
9
|
+
get posts(): Posts;
|
|
4
10
|
/**
|
|
5
11
|
* Login the user and also return an access token the API client can use for further authentication
|
|
6
12
|
*/
|
|
7
|
-
login(request: operations.UserLoginRequest, options?: RequestOptions): Promise<operations.UserLoginResponse
|
|
13
|
+
login(request: operations.UserLoginRequest, options?: RequestOptions): Promise<operations.UserLoginResponse>;
|
|
8
14
|
/**
|
|
9
15
|
* Signup the given user
|
|
10
16
|
*/
|
|
11
|
-
signup(request: operations.UserSignupRequest, options?: RequestOptions): Promise<operations.UserSignupResponse
|
|
17
|
+
signup(request: operations.UserSignupRequest, options?: RequestOptions): Promise<operations.UserSignupResponse>;
|
|
12
18
|
/**
|
|
13
19
|
* Get the currently authenticated user's profile
|
|
14
20
|
*/
|
|
15
|
-
me(options?: RequestOptions): Promise<operations.GetCurrentUserResponse
|
|
21
|
+
me(options?: RequestOptions): Promise<operations.GetCurrentUserResponse>;
|
|
16
22
|
/**
|
|
17
23
|
* Get a user's public profile by ID
|
|
18
24
|
*/
|
|
19
|
-
get(request: operations.GetUserByIdRequest, options?: RequestOptions): Promise<operations.GetUserByIdResponse
|
|
25
|
+
get(request: operations.GetUserByIdRequest, options?: RequestOptions): Promise<operations.GetUserByIdResponse>;
|
|
20
26
|
/**
|
|
21
27
|
* Update a user's profile (own profile only)
|
|
22
28
|
*/
|
|
23
|
-
update(request: operations.UpdateUserRequest, options?: RequestOptions): Promise<operations.UpdateUserResponse
|
|
29
|
+
update(request: operations.UpdateUserRequest, options?: RequestOptions): Promise<operations.UpdateUserResponse>;
|
|
24
30
|
/**
|
|
25
31
|
* Soft delete a user account (own account only)
|
|
26
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/sdk/users.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/sdk/users.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,KAAM,SAAQ,SAAS;IAClC,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;OAEG;IACG,KAAK,CACT,OAAO,EAAE,UAAU,CAAC,gBAAgB,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAQxC;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;OAEG;IACG,EAAE,CACN,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAO7C;;OAEG;IACG,GAAG,CACP,OAAO,EAAE,UAAU,CAAC,kBAAkB,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;IAQzC;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,iBAAiB,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CAOjB"}
|
package/dist/esm/sdk/users.js
CHANGED
|
@@ -9,7 +9,15 @@ import { usersSignup } from "../funcs/users-signup.js";
|
|
|
9
9
|
import { usersUpdate } from "../funcs/users-update.js";
|
|
10
10
|
import { ClientSDK } from "../lib/sdks.js";
|
|
11
11
|
import { unwrapAsync } from "../types/fp.js";
|
|
12
|
+
import { Activities } from "./activities.js";
|
|
13
|
+
import { Posts } from "./posts.js";
|
|
12
14
|
export class Users extends ClientSDK {
|
|
15
|
+
get activities() {
|
|
16
|
+
return (this._activities ?? (this._activities = new Activities(this._options)));
|
|
17
|
+
}
|
|
18
|
+
get posts() {
|
|
19
|
+
return (this._posts ?? (this._posts = new Posts(this._options)));
|
|
20
|
+
}
|
|
13
21
|
/**
|
|
14
22
|
* Login the user and also return an access token the API client can use for further authentication
|
|
15
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/sdk/users.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/sdk/users.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,OAAO,KAAM,SAAQ,SAAS;IAElC,IAAI,UAAU;QACZ,OAAO,CAAC,IAAI,CAAC,WAAW,KAAhB,IAAI,CAAC,WAAW,GAAK,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC9D,CAAC;IAGD,IAAI,KAAK;QACP,OAAO,CAAC,IAAI,CAAC,MAAM,KAAX,IAAI,CAAC,MAAM,GAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CACT,OAAoC,EACpC,OAAwB;QAExB,OAAO,WAAW,CAAC,UAAU,CAC3B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,WAAW,CAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,EAAE,CACN,OAAwB;QAExB,OAAO,WAAW,CAAC,OAAO,CACxB,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAAsC,EACtC,OAAwB;QAExB,OAAO,WAAW,CAAC,QAAQ,CACzB,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,WAAW,CAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAAqC,EACrC,OAAwB;QAExB,OAAO,WAAW,CAAC,WAAW,CAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
describe('User Activity Posts Endpoints Unit Tests', () => {
|
|
2
|
+
afterEach(() => {
|
|
3
|
+
cy.task('reseedUserActivityPostsTable');
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
// Get user activity posts by user ID
|
|
7
|
+
it('Getting user activity posts by user ID should fail due to invalid access token', () => {
|
|
8
|
+
cy.request({
|
|
9
|
+
failOnStatusCode: false,
|
|
10
|
+
method: "get",
|
|
11
|
+
url: "users/2/posts",
|
|
12
|
+
headers: {
|
|
13
|
+
"Authorization": "Bearer invalidBearer"
|
|
14
|
+
}
|
|
15
|
+
}).then(response => {
|
|
16
|
+
expect(response.status).to.equal(401, "Getting user activity posts by user ID should have failed with HTTP 401; different code was found instead!");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('Getting user activity posts by user ID should fail due to invalid user ID', () => {
|
|
21
|
+
cy.request({
|
|
22
|
+
failOnStatusCode: false,
|
|
23
|
+
method: "get",
|
|
24
|
+
url: "users/99/posts",
|
|
25
|
+
headers: {
|
|
26
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
27
|
+
}
|
|
28
|
+
}).then(response => {
|
|
29
|
+
expect(response.status).to.equal(404, "Getting user activity posts by user ID should have failed with HTTP 404; different code was found instead!");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('Getting user activity posts by user ID should succeed', () => {
|
|
34
|
+
cy.request({
|
|
35
|
+
method: "get",
|
|
36
|
+
url: "users/2/posts",
|
|
37
|
+
headers: {
|
|
38
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
39
|
+
}
|
|
40
|
+
}).then(response => {
|
|
41
|
+
expect(response.status).to.equal(200, "Getting user activity posts by user ID should have succeeded; got non-success code instead!");
|
|
42
|
+
expect(response.body).to.be.an("array");
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Get social feed
|
|
47
|
+
|
|
48
|
+
// TODO: find a way to add many posts and test pagination and per-request entry limits
|
|
49
|
+
// to ensure result set size is compliant with API spec
|
|
50
|
+
|
|
51
|
+
it('Getting social feed should fail due to invalid bearer token', () => {
|
|
52
|
+
cy.request({
|
|
53
|
+
failOnStatusCode: false,
|
|
54
|
+
method: "get",
|
|
55
|
+
url: "feed",
|
|
56
|
+
headers: {
|
|
57
|
+
"Authorization": "Bearer invalidBearer"
|
|
58
|
+
}
|
|
59
|
+
}).then(response => {
|
|
60
|
+
expect(response.status).to.equal(401, "Getting social feed should have failed with HTTP 401; different code was found instead!");
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('Getting social feed should succeed', () => {
|
|
65
|
+
cy.request({
|
|
66
|
+
method: "get",
|
|
67
|
+
url: "feed",
|
|
68
|
+
failOnStatusCode: false,
|
|
69
|
+
headers: {
|
|
70
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
71
|
+
}
|
|
72
|
+
}).then(response => {
|
|
73
|
+
// TODO change status code once social feed is implemented
|
|
74
|
+
expect(response.status).to.equal(501, "Getting social feed should have succeeded; got non-success code instead!");
|
|
75
|
+
// expect(response.body).to.be.an("array");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Get post by ID
|
|
80
|
+
it('Getting post by ID should fail due to invalid bearer token', () => {
|
|
81
|
+
cy.request({
|
|
82
|
+
failOnStatusCode: false,
|
|
83
|
+
method: "get",
|
|
84
|
+
url: "posts/1",
|
|
85
|
+
headers: {
|
|
86
|
+
"Authorization": "Bearer invalidBearer"
|
|
87
|
+
}
|
|
88
|
+
}).then(response => {
|
|
89
|
+
expect(response.status).to.equal(401, "Getting post by ID should have failed with HTTP 401; different code was found instead!");
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('Getting post by ID should fail due to invalid post ID', () => {
|
|
94
|
+
cy.request({
|
|
95
|
+
failOnStatusCode: false,
|
|
96
|
+
method: "get",
|
|
97
|
+
url: "posts/0",
|
|
98
|
+
headers: {
|
|
99
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
100
|
+
}
|
|
101
|
+
}).then(response => {
|
|
102
|
+
expect(response.status).to.equal(404, "Getting post by ID should have failed with HTTP 404; different code was found instead!");
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('Getting post by ID should succeed', () => {
|
|
107
|
+
cy.request({
|
|
108
|
+
method: "get",
|
|
109
|
+
url: "posts/1",
|
|
110
|
+
headers: {
|
|
111
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
112
|
+
}
|
|
113
|
+
}).then(response => {
|
|
114
|
+
expect(response.status).to.equal(200, "Getting post by ID should have should have succeeded; got non-success code instead!");
|
|
115
|
+
expect(response.body).to.be.an("object");
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Update post
|
|
120
|
+
it('Updating post by ID should fail due to invalid bearer token', () => {
|
|
121
|
+
cy.request({
|
|
122
|
+
failOnStatusCode: false,
|
|
123
|
+
method: "patch",
|
|
124
|
+
url: "posts/1",
|
|
125
|
+
headers: {
|
|
126
|
+
"Authorization": "Bearer invalidBearer"
|
|
127
|
+
},
|
|
128
|
+
body: {
|
|
129
|
+
caption: "sample caption from unit tests!",
|
|
130
|
+
postStatus: "public"
|
|
131
|
+
}
|
|
132
|
+
}).then(response => {
|
|
133
|
+
expect(response.status).to.equal(401, "Updating post by ID should have failed with HTTP 401; different code was found instead!");
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('Updating post by ID should fail due to invalid post ID', () => {
|
|
138
|
+
cy.request({
|
|
139
|
+
failOnStatusCode: false,
|
|
140
|
+
method: "patch",
|
|
141
|
+
url: "posts/0",
|
|
142
|
+
headers: {
|
|
143
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
144
|
+
},
|
|
145
|
+
body: {
|
|
146
|
+
caption: "sample caption from unit tests!",
|
|
147
|
+
postStatus: "public"
|
|
148
|
+
}
|
|
149
|
+
}).then(response => {
|
|
150
|
+
expect(response.status).to.equal(404, "Updating post by ID should have failed with HTTP 404; different code was found instead!");
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('Updating post by ID should fail due to invalid post status', () => {
|
|
155
|
+
cy.request({
|
|
156
|
+
failOnStatusCode: false,
|
|
157
|
+
method: "patch",
|
|
158
|
+
url: "posts/1",
|
|
159
|
+
headers: {
|
|
160
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
161
|
+
},
|
|
162
|
+
body: {
|
|
163
|
+
caption: "sample caption from unit tests!",
|
|
164
|
+
postStatus: "invalidStatus"
|
|
165
|
+
}
|
|
166
|
+
}).then(response => {
|
|
167
|
+
expect(response.status).to.equal(400, "Updating post by ID should have failed with HTTP 400; different code was found instead!");
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('Updating post by ID should fail due to invalid data input', () => {
|
|
172
|
+
cy.request({
|
|
173
|
+
failOnStatusCode: false,
|
|
174
|
+
method: "patch",
|
|
175
|
+
url: "posts/1",
|
|
176
|
+
headers: {
|
|
177
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
178
|
+
},
|
|
179
|
+
body: {}
|
|
180
|
+
}).then(response => {
|
|
181
|
+
expect(response.status).to.equal(400, "Updating post by ID should have failed with HTTP 400; different code was found instead!");
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('Updating post by ID should succeed', () => {
|
|
186
|
+
cy.request({
|
|
187
|
+
method: "patch",
|
|
188
|
+
url: "posts/1",
|
|
189
|
+
headers: {
|
|
190
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
191
|
+
},
|
|
192
|
+
body: {
|
|
193
|
+
caption: "sample caption from unit tests!",
|
|
194
|
+
postStatus: "public"
|
|
195
|
+
}
|
|
196
|
+
}).then(response => {
|
|
197
|
+
expect(response.status).to.equal(200, "Updating post by ID should have succeeded; got non-success code instead!");
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// Delete post
|
|
202
|
+
it('Deleting post by ID should fail due to invalid bearer token', () => {
|
|
203
|
+
cy.request({
|
|
204
|
+
failOnStatusCode: false,
|
|
205
|
+
method: "delete",
|
|
206
|
+
url: "posts/1",
|
|
207
|
+
headers: {
|
|
208
|
+
"Authorization": "Bearer invalidBearer"
|
|
209
|
+
},
|
|
210
|
+
}).then(response => {
|
|
211
|
+
expect(response.status).to.equal(401, "Deleting post by ID should have failed with HTTP 401; different code was found instead!");
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('Deleting post by ID should fail due to invalid post ID', () => {
|
|
216
|
+
cy.request({
|
|
217
|
+
failOnStatusCode: false,
|
|
218
|
+
method: "delete",
|
|
219
|
+
url: "posts/0",
|
|
220
|
+
headers: {
|
|
221
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
222
|
+
},
|
|
223
|
+
}).then(response => {
|
|
224
|
+
expect(response.status).to.equal(404, "Deleting post by ID should have failed with HTTP 404; different code was found instead!");
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it('Deleting post by ID should succeed', () => {
|
|
229
|
+
cy.request({
|
|
230
|
+
method: "delete",
|
|
231
|
+
url: "posts/1",
|
|
232
|
+
headers: {
|
|
233
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
234
|
+
},
|
|
235
|
+
}).then(response => {
|
|
236
|
+
expect(response.status).to.equal(200, "Deleting post by ID should have succeeded; got non-success code instead!");
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
});
|
|
@@ -13,7 +13,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
13
13
|
"Authorization": "Bearer invalidBearer"
|
|
14
14
|
}
|
|
15
15
|
}).then(response => {
|
|
16
|
-
expect(response.status).to.equal(401, "
|
|
16
|
+
expect(response.status).to.equal(401, "Getting user activities by ID should have failed with HTTP 400; different code was found instead!");
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -26,7 +26,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
26
26
|
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
27
27
|
}
|
|
28
28
|
}).then(response => {
|
|
29
|
-
expect(response.status).to.equal(404, "
|
|
29
|
+
expect(response.status).to.equal(404, "Getting user activities by ID should have failed with HTTP 400; different code was found instead!");
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
38
38
|
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
39
39
|
}
|
|
40
40
|
}).then(response => {
|
|
41
|
-
expect(response.status).to.equal(200, "
|
|
41
|
+
expect(response.status).to.equal(200, "Getting user activities by ID should have succeeded; got non-success code instead");
|
|
42
42
|
expect(response.body).to.be.an("array");
|
|
43
43
|
});
|
|
44
44
|
});
|
|
@@ -53,7 +53,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
53
53
|
"Authorization": "Bearer invalidBearer"
|
|
54
54
|
}
|
|
55
55
|
}).then(response => {
|
|
56
|
-
expect(response.status).to.equal(401, "
|
|
56
|
+
expect(response.status).to.equal(401, "Getting current user activities should have failed with HTTP 400; different code was found instead!");
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
|
|
@@ -65,7 +65,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
65
65
|
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
66
66
|
}
|
|
67
67
|
}).then(response => {
|
|
68
|
-
expect(response.status).to.equal(200, "
|
|
68
|
+
expect(response.status).to.equal(200, "Getting current user activities should have succeeded; got non-success code instead");
|
|
69
69
|
expect(response.body).to.be.an("array");
|
|
70
70
|
});
|
|
71
71
|
});
|
|
@@ -86,7 +86,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
86
86
|
isPrivate: false
|
|
87
87
|
}
|
|
88
88
|
}).then(response => {
|
|
89
|
-
expect(response.status).to.equal(401, "
|
|
89
|
+
expect(response.status).to.equal(401, "Creating activity should have failed with HTTP 400; different code was found instead!");
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -99,7 +99,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
99
99
|
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
100
100
|
}
|
|
101
101
|
}).then(response => {
|
|
102
|
-
expect(response.status).to.equal(400, "
|
|
102
|
+
expect(response.status).to.equal(400, "Creating activity should have failed with HTTP 400; different code was found instead!");
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
|
|
@@ -117,7 +117,7 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
117
117
|
isPrivate: false
|
|
118
118
|
}
|
|
119
119
|
}).then(response => {
|
|
120
|
-
expect(response.status).to.equal(200, "
|
|
120
|
+
expect(response.status).to.equal(200, "Creating activity should have failed with HTTP 400; different code was found instead!");
|
|
121
121
|
expect(response.body).to.be.an("object");
|
|
122
122
|
});
|
|
123
123
|
});
|
|
@@ -259,16 +259,4 @@ describe('User Activity Endpoints Unit Tests', () => {
|
|
|
259
259
|
expect(response.status).to.equal(404, "Deleting activity should have failed with HTTP 404; different code was found instead!");
|
|
260
260
|
});
|
|
261
261
|
});
|
|
262
|
-
|
|
263
|
-
it('Deleting activity should succeed', () => {
|
|
264
|
-
cy.request({
|
|
265
|
-
method: "delete",
|
|
266
|
-
url: "activities/1",
|
|
267
|
-
headers: {
|
|
268
|
-
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252",
|
|
269
|
-
},
|
|
270
|
-
}).then(response => {
|
|
271
|
-
expect(response.status).to.equal(200, "Deleting activity should have have succeeded; got non-success code instead!");
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
262
|
});
|
|
@@ -43,7 +43,7 @@ describe('User Endpoints Unit Tests', () => {
|
|
|
43
43
|
});
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
it('Login succeeds
|
|
46
|
+
it('Login succeeds', () => {
|
|
47
47
|
cy.request("POST", "login", { username: "UnitTester", password: "unitTester" }).then(response => {
|
|
48
48
|
expect(response.status).to.equal(200, "Login should have succeeded; failed on login status return code check!");
|
|
49
49
|
expect(response.body).to.haveOwnProperty(
|
|
@@ -131,7 +131,7 @@ describe('User Endpoints Unit Tests', () => {
|
|
|
131
131
|
});
|
|
132
132
|
})
|
|
133
133
|
|
|
134
|
-
it('Getting private user profile succeeds
|
|
134
|
+
it('Getting private user profile succeeds', () => {
|
|
135
135
|
cy.request({
|
|
136
136
|
failOnStatusCode: false,
|
|
137
137
|
method: "get",
|
|
@@ -168,7 +168,7 @@ describe('User Endpoints Unit Tests', () => {
|
|
|
168
168
|
});
|
|
169
169
|
})
|
|
170
170
|
|
|
171
|
-
it('Getting public user profile succeeds
|
|
171
|
+
it('Getting public user profile succeeds', () => {
|
|
172
172
|
cy.request({
|
|
173
173
|
url: "users/2",
|
|
174
174
|
headers: {
|
|
@@ -7,38 +7,44 @@ export default defineConfig({
|
|
|
7
7
|
on('task', {
|
|
8
8
|
// drop test artifacts
|
|
9
9
|
async reseedUsersTable() {
|
|
10
|
-
await prisma.$
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
return await prisma.$transaction([
|
|
11
|
+
prisma.$executeRaw`DELETE FROM users WHERE user_id != 2;`,
|
|
12
|
+
prisma.$executeRaw`UPDATE users SET is_soft_deleted = 0, first_name = 'Unit', last_name = 'Test', username = 'UnitTester' WHERE user_id = 2;`
|
|
13
|
+
]);
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
async reseedCategoriesTable() {
|
|
17
|
-
await prisma
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
return await prisma.$transaction([
|
|
18
|
+
prisma.category.deleteMany({
|
|
19
|
+
where: {
|
|
20
|
+
category_id: {
|
|
21
|
+
notIn: [1, 2, 3, 4]
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
await prisma.$executeRaw`REPLACE INTO Category (category_id, category_name, category_weight, category_description) VALUES (1, 'Academic', 3, 'Studying for an exam, completing coursework, etc.')`;
|
|
26
|
-
|
|
27
|
-
return true;
|
|
24
|
+
}),
|
|
25
|
+
prisma.$executeRaw`REPLACE INTO Category (category_id, category_name, category_weight, category_description) VALUES (1, 'Academic', 3, 'Studying for an exam, completing coursework, etc.');`
|
|
26
|
+
]);
|
|
28
27
|
},
|
|
29
28
|
|
|
30
29
|
async reseedUserActivityTable() {
|
|
31
|
-
await prisma
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
return await prisma.$transaction([
|
|
31
|
+
prisma.user_Activity.deleteMany({
|
|
32
|
+
where: {
|
|
33
|
+
activity_id: {
|
|
34
|
+
not: 1
|
|
35
|
+
}
|
|
35
36
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
}),
|
|
38
|
+
prisma.$executeRaw`SET FOREIGN_KEY_CHECKS = 0;`,
|
|
39
|
+
prisma.$executeRaw`REPLACE INTO User_Activity (activity_id, user_id, category_name, activity_deadline, details) VALUES (1, 2, 'Professional', '2026-03-01 23:59:00', '');`,
|
|
40
|
+
prisma.$executeRaw`SET FOREIGN_KEY_CHECKS = 1;`
|
|
41
|
+
]);
|
|
42
|
+
},
|
|
40
43
|
|
|
41
|
-
|
|
44
|
+
async reseedUserActivityPostsTable() {
|
|
45
|
+
return await prisma.$transaction([
|
|
46
|
+
prisma.$executeRaw`REPLACE INTO User_Activity_Posts (post_id, user_id, category_name, activity_id, post_date, post_status, caption) VALUES (1, 2, 'Professional', 1, '2026-02-28 22:15:02', 'public', 'This is a test post! Nothing much going on here...');`
|
|
47
|
+
])
|
|
42
48
|
}
|
|
43
49
|
})
|
|
44
50
|
},
|
package/rest-api/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import { readFileSync } from 'node:fs';
|
|
|
7
7
|
import * as UserFuctions from "./routes/UserFunctions.js";
|
|
8
8
|
import * as SchoolFunctions from "./routes/SchoolFunctions.js";
|
|
9
9
|
import * as CategoryFunctions from "./routes/CategoryFunctions.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as UserActivityFunctions from "./routes/UserActivityFunctions.js";
|
|
11
|
+
import * as ActivityPostFunctions from "./routes/ActivityPostFunctions.js";
|
|
11
12
|
|
|
12
13
|
const spec = yamlLoad(readFileSync("./api-spec.yaml"));
|
|
13
14
|
|
|
@@ -31,12 +32,17 @@ const handler = {
|
|
|
31
32
|
createCategory: CategoryFunctions.createCategoryHandler,
|
|
32
33
|
updateCategory: CategoryFunctions.updateCategoryHandler,
|
|
33
34
|
deleteCategory: CategoryFunctions.deleteCategoryHandler,
|
|
34
|
-
getUserActivities:
|
|
35
|
-
listActivities:
|
|
36
|
-
createActivity:
|
|
37
|
-
getActivityById:
|
|
38
|
-
updateActivity:
|
|
39
|
-
deleteActivity:
|
|
35
|
+
getUserActivities: UserActivityFunctions.getUserActivitiesHandler,
|
|
36
|
+
listActivities: UserActivityFunctions.listActivitiesHandler,
|
|
37
|
+
createActivity: UserActivityFunctions.createActivityHandler,
|
|
38
|
+
getActivityById: UserActivityFunctions.getActivityByIdHandler,
|
|
39
|
+
updateActivity: UserActivityFunctions.updateActivityHandler,
|
|
40
|
+
deleteActivity: UserActivityFunctions.deleteActivityHandler,
|
|
41
|
+
getUserPosts: ActivityPostFunctions.getUserPostsHandler,
|
|
42
|
+
getFeed: ActivityPostFunctions.getFeedHandler,
|
|
43
|
+
getPostById: ActivityPostFunctions.getPostByIdHandler,
|
|
44
|
+
updatePost: ActivityPostFunctions.updatePostHandler,
|
|
45
|
+
deletePost: ActivityPostFunctions.deletePostHandler
|
|
40
46
|
};
|
|
41
47
|
|
|
42
48
|
fastify.register(oasFastify, { spec, handler });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export async function getUserAuthInfo(prisma, accessToken) {
|
|
2
|
+
return await prisma.users.findFirst({
|
|
3
|
+
where: {
|
|
4
|
+
access_token: accessToken
|
|
5
|
+
},
|
|
6
|
+
select: {
|
|
7
|
+
user_id: true
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function areUsersFriends(prisma, userId, targetPotentialFriendId) {
|
|
13
|
+
const friendInfo = await prisma.User_Friends.findFirst({
|
|
14
|
+
where: {
|
|
15
|
+
OR: [
|
|
16
|
+
{
|
|
17
|
+
user_id: userId,
|
|
18
|
+
friend_id: targetPotentialFriendId,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
user_id: targetPotentialFriendId,
|
|
22
|
+
friend_id: userId,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (friendInfo === null) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return true;
|
|
33
|
+
}
|