@aurora-interactive/sensei-productivity 1.6.0 → 1.8.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 +4 -0
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/dist/commonjs/funcs/schools-get.js.map +1 -1
- package/dist/commonjs/funcs/users-activities-create.d.ts +1 -1
- package/dist/commonjs/funcs/users-activities-create.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-activities-create.js +3 -2
- package/dist/commonjs/funcs/users-activities-create.js.map +1 -1
- package/dist/commonjs/funcs/users-activities-delete.js +2 -2
- package/dist/commonjs/funcs/users-activities-delete.js.map +1 -1
- package/dist/commonjs/funcs/users-activities-get-all-of-user.d.ts +1 -1
- package/dist/commonjs/funcs/users-activities-get-all-of-user.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-activities-get-all-of-user.js +3 -2
- package/dist/commonjs/funcs/users-activities-get-all-of-user.js.map +1 -1
- package/dist/commonjs/funcs/users-activities-get.d.ts +1 -1
- package/dist/commonjs/funcs/users-activities-get.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-activities-get.js +3 -2
- package/dist/commonjs/funcs/users-activities-get.js.map +1 -1
- package/dist/commonjs/funcs/users-activities-me.d.ts +1 -1
- package/dist/commonjs/funcs/users-activities-me.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-activities-me.js +3 -2
- package/dist/commonjs/funcs/users-activities-me.js.map +1 -1
- package/dist/commonjs/funcs/users-activities-update.d.ts +1 -1
- package/dist/commonjs/funcs/users-activities-update.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-activities-update.js +3 -2
- package/dist/commonjs/funcs/users-activities-update.js.map +1 -1
- package/dist/commonjs/funcs/users-delete.js +2 -2
- package/dist/commonjs/funcs/users-delete.js.map +1 -1
- package/dist/commonjs/funcs/users-friends-accept.js +2 -2
- package/dist/commonjs/funcs/users-friends-accept.js.map +1 -1
- package/dist/commonjs/funcs/users-friends-list.d.ts +1 -1
- package/dist/commonjs/funcs/users-friends-list.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-friends-list.js +3 -2
- package/dist/commonjs/funcs/users-friends-list.js.map +1 -1
- package/dist/commonjs/funcs/users-friends-pending.d.ts +1 -1
- package/dist/commonjs/funcs/users-friends-pending.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-friends-pending.js +3 -2
- package/dist/commonjs/funcs/users-friends-pending.js.map +1 -1
- package/dist/commonjs/funcs/users-friends-reject.js +2 -2
- package/dist/commonjs/funcs/users-friends-reject.js.map +1 -1
- package/dist/commonjs/funcs/users-friends-remove.js +2 -2
- package/dist/commonjs/funcs/users-friends-remove.js.map +1 -1
- package/dist/commonjs/funcs/users-friends-send-request.js +2 -2
- package/dist/commonjs/funcs/users-friends-send-request.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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/dist/commonjs/funcs/users-me.js.map +1 -1
- package/dist/commonjs/funcs/users-posts-delete.js +2 -2
- package/dist/commonjs/funcs/users-posts-delete.js.map +1 -1
- package/dist/commonjs/funcs/users-posts-feed.d.ts +1 -1
- package/dist/commonjs/funcs/users-posts-feed.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-posts-feed.js +3 -2
- package/dist/commonjs/funcs/users-posts-feed.js.map +1 -1
- package/dist/commonjs/funcs/users-posts-get-by-post-id.d.ts +1 -1
- package/dist/commonjs/funcs/users-posts-get-by-post-id.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-posts-get-by-post-id.js +3 -2
- package/dist/commonjs/funcs/users-posts-get-by-post-id.js.map +1 -1
- package/dist/commonjs/funcs/users-posts-get-by-user-id.d.ts +1 -1
- package/dist/commonjs/funcs/users-posts-get-by-user-id.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-posts-get-by-user-id.js +3 -2
- package/dist/commonjs/funcs/users-posts-get-by-user-id.js.map +1 -1
- package/dist/commonjs/funcs/users-posts-like.d.ts +14 -0
- package/dist/commonjs/funcs/users-posts-like.d.ts.map +1 -0
- package/dist/commonjs/funcs/users-posts-like.js +127 -0
- package/dist/commonjs/funcs/users-posts-like.js.map +1 -0
- package/dist/commonjs/funcs/users-posts-remove-like.d.ts +14 -0
- package/dist/commonjs/funcs/users-posts-remove-like.d.ts.map +1 -0
- package/dist/commonjs/funcs/users-posts-remove-like.js +127 -0
- package/dist/commonjs/funcs/users-posts-remove-like.js.map +1 -0
- package/dist/commonjs/funcs/users-posts-update.d.ts +1 -1
- package/dist/commonjs/funcs/users-posts-update.d.ts.map +1 -1
- package/dist/commonjs/funcs/users-posts-update.js +3 -2
- package/dist/commonjs/funcs/users-posts-update.js.map +1 -1
- 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 +3 -2
- 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 +3 -2
- 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/lib/files.d.ts +13 -0
- package/dist/commonjs/lib/files.d.ts.map +1 -1
- package/dist/commonjs/lib/files.js +19 -0
- package/dist/commonjs/lib/files.js.map +1 -1
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +8 -4
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/lib/url.d.ts.map +1 -1
- package/dist/commonjs/lib/url.js +4 -2
- package/dist/commonjs/lib/url.js.map +1 -1
- package/dist/commonjs/models/operations/get-feed.d.ts +2 -0
- package/dist/commonjs/models/operations/get-feed.d.ts.map +1 -1
- package/dist/commonjs/models/operations/get-feed.js +2 -0
- package/dist/commonjs/models/operations/get-feed.js.map +1 -1
- package/dist/commonjs/models/operations/get-post-by-id.d.ts +2 -0
- package/dist/commonjs/models/operations/get-post-by-id.d.ts.map +1 -1
- package/dist/commonjs/models/operations/get-post-by-id.js +2 -0
- package/dist/commonjs/models/operations/get-post-by-id.js.map +1 -1
- package/dist/commonjs/models/operations/get-user-posts.d.ts +2 -0
- package/dist/commonjs/models/operations/get-user-posts.d.ts.map +1 -1
- package/dist/commonjs/models/operations/get-user-posts.js +2 -0
- package/dist/commonjs/models/operations/get-user-posts.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/like-post.d.ts +12 -0
- package/dist/commonjs/models/operations/like-post.d.ts.map +1 -0
- package/dist/commonjs/models/operations/like-post.js +49 -0
- package/dist/commonjs/models/operations/like-post.js.map +1 -0
- package/dist/commonjs/models/operations/unlike-post.d.ts +12 -0
- package/dist/commonjs/models/operations/unlike-post.d.ts.map +1 -0
- package/dist/commonjs/models/operations/unlike-post.js +49 -0
- package/dist/commonjs/models/operations/unlike-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/categories.d.ts +3 -3
- package/dist/commonjs/sdk/categories.d.ts.map +1 -1
- package/dist/commonjs/sdk/friends.d.ts +2 -2
- package/dist/commonjs/sdk/friends.d.ts.map +1 -1
- package/dist/commonjs/sdk/posts.d.ts +12 -4
- package/dist/commonjs/sdk/posts.d.ts.map +1 -1
- package/dist/commonjs/sdk/posts.js +14 -0
- package/dist/commonjs/sdk/posts.js.map +1 -1
- package/dist/commonjs/sdk/schools.d.ts +1 -1
- package/dist/commonjs/sdk/schools.d.ts.map +1 -1
- package/dist/commonjs/sdk/users.d.ts +5 -5
- package/dist/commonjs/sdk/users.d.ts.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 +3 -2
- 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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/dist/esm/funcs/schools-get.js.map +1 -1
- package/dist/esm/funcs/users-activities-create.d.ts +1 -1
- package/dist/esm/funcs/users-activities-create.d.ts.map +1 -1
- package/dist/esm/funcs/users-activities-create.js +3 -2
- package/dist/esm/funcs/users-activities-create.js.map +1 -1
- package/dist/esm/funcs/users-activities-delete.js +2 -2
- package/dist/esm/funcs/users-activities-delete.js.map +1 -1
- package/dist/esm/funcs/users-activities-get-all-of-user.d.ts +1 -1
- package/dist/esm/funcs/users-activities-get-all-of-user.d.ts.map +1 -1
- package/dist/esm/funcs/users-activities-get-all-of-user.js +3 -2
- package/dist/esm/funcs/users-activities-get-all-of-user.js.map +1 -1
- package/dist/esm/funcs/users-activities-get.d.ts +1 -1
- package/dist/esm/funcs/users-activities-get.d.ts.map +1 -1
- package/dist/esm/funcs/users-activities-get.js +3 -2
- package/dist/esm/funcs/users-activities-get.js.map +1 -1
- package/dist/esm/funcs/users-activities-me.d.ts +1 -1
- package/dist/esm/funcs/users-activities-me.d.ts.map +1 -1
- package/dist/esm/funcs/users-activities-me.js +3 -2
- package/dist/esm/funcs/users-activities-me.js.map +1 -1
- package/dist/esm/funcs/users-activities-update.d.ts +1 -1
- package/dist/esm/funcs/users-activities-update.d.ts.map +1 -1
- package/dist/esm/funcs/users-activities-update.js +3 -2
- package/dist/esm/funcs/users-activities-update.js.map +1 -1
- package/dist/esm/funcs/users-delete.js +2 -2
- package/dist/esm/funcs/users-delete.js.map +1 -1
- package/dist/esm/funcs/users-friends-accept.js +2 -2
- package/dist/esm/funcs/users-friends-accept.js.map +1 -1
- package/dist/esm/funcs/users-friends-list.d.ts +1 -1
- package/dist/esm/funcs/users-friends-list.d.ts.map +1 -1
- package/dist/esm/funcs/users-friends-list.js +3 -2
- package/dist/esm/funcs/users-friends-list.js.map +1 -1
- package/dist/esm/funcs/users-friends-pending.d.ts +1 -1
- package/dist/esm/funcs/users-friends-pending.d.ts.map +1 -1
- package/dist/esm/funcs/users-friends-pending.js +3 -2
- package/dist/esm/funcs/users-friends-pending.js.map +1 -1
- package/dist/esm/funcs/users-friends-reject.js +2 -2
- package/dist/esm/funcs/users-friends-reject.js.map +1 -1
- package/dist/esm/funcs/users-friends-remove.js +2 -2
- package/dist/esm/funcs/users-friends-remove.js.map +1 -1
- package/dist/esm/funcs/users-friends-send-request.js +2 -2
- package/dist/esm/funcs/users-friends-send-request.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 +3 -2
- 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 +3 -2
- 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 +3 -2
- package/dist/esm/funcs/users-me.js.map +1 -1
- package/dist/esm/funcs/users-posts-delete.js +2 -2
- package/dist/esm/funcs/users-posts-delete.js.map +1 -1
- package/dist/esm/funcs/users-posts-feed.d.ts +1 -1
- package/dist/esm/funcs/users-posts-feed.d.ts.map +1 -1
- package/dist/esm/funcs/users-posts-feed.js +3 -2
- package/dist/esm/funcs/users-posts-feed.js.map +1 -1
- package/dist/esm/funcs/users-posts-get-by-post-id.d.ts +1 -1
- package/dist/esm/funcs/users-posts-get-by-post-id.d.ts.map +1 -1
- package/dist/esm/funcs/users-posts-get-by-post-id.js +3 -2
- package/dist/esm/funcs/users-posts-get-by-post-id.js.map +1 -1
- package/dist/esm/funcs/users-posts-get-by-user-id.d.ts +1 -1
- package/dist/esm/funcs/users-posts-get-by-user-id.d.ts.map +1 -1
- package/dist/esm/funcs/users-posts-get-by-user-id.js +3 -2
- package/dist/esm/funcs/users-posts-get-by-user-id.js.map +1 -1
- package/dist/esm/funcs/users-posts-like.d.ts +14 -0
- package/dist/esm/funcs/users-posts-like.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-like.js +91 -0
- package/dist/esm/funcs/users-posts-like.js.map +1 -0
- package/dist/esm/funcs/users-posts-remove-like.d.ts +14 -0
- package/dist/esm/funcs/users-posts-remove-like.d.ts.map +1 -0
- package/dist/esm/funcs/users-posts-remove-like.js +91 -0
- package/dist/esm/funcs/users-posts-remove-like.js.map +1 -0
- package/dist/esm/funcs/users-posts-update.d.ts +1 -1
- package/dist/esm/funcs/users-posts-update.d.ts.map +1 -1
- package/dist/esm/funcs/users-posts-update.js +3 -2
- package/dist/esm/funcs/users-posts-update.js.map +1 -1
- 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 +3 -2
- 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 +3 -2
- 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/lib/files.d.ts +13 -0
- package/dist/esm/lib/files.d.ts.map +1 -1
- package/dist/esm/lib/files.js +18 -0
- package/dist/esm/lib/files.js.map +1 -1
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +8 -4
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/lib/url.d.ts.map +1 -1
- package/dist/esm/lib/url.js +4 -2
- package/dist/esm/lib/url.js.map +1 -1
- package/dist/esm/models/operations/get-feed.d.ts +2 -0
- package/dist/esm/models/operations/get-feed.d.ts.map +1 -1
- package/dist/esm/models/operations/get-feed.js +2 -0
- package/dist/esm/models/operations/get-feed.js.map +1 -1
- package/dist/esm/models/operations/get-post-by-id.d.ts +2 -0
- package/dist/esm/models/operations/get-post-by-id.d.ts.map +1 -1
- package/dist/esm/models/operations/get-post-by-id.js +2 -0
- package/dist/esm/models/operations/get-post-by-id.js.map +1 -1
- package/dist/esm/models/operations/get-user-posts.d.ts +2 -0
- package/dist/esm/models/operations/get-user-posts.d.ts.map +1 -1
- package/dist/esm/models/operations/get-user-posts.js +2 -0
- package/dist/esm/models/operations/get-user-posts.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/like-post.d.ts +12 -0
- package/dist/esm/models/operations/like-post.d.ts.map +1 -0
- package/dist/esm/models/operations/like-post.js +12 -0
- package/dist/esm/models/operations/like-post.js.map +1 -0
- package/dist/esm/models/operations/unlike-post.d.ts +12 -0
- package/dist/esm/models/operations/unlike-post.d.ts.map +1 -0
- package/dist/esm/models/operations/unlike-post.js +12 -0
- package/dist/esm/models/operations/unlike-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/categories.d.ts +3 -3
- package/dist/esm/sdk/categories.d.ts.map +1 -1
- package/dist/esm/sdk/friends.d.ts +2 -2
- package/dist/esm/sdk/friends.d.ts.map +1 -1
- package/dist/esm/sdk/posts.d.ts +12 -4
- package/dist/esm/sdk/posts.d.ts.map +1 -1
- package/dist/esm/sdk/posts.js +14 -0
- package/dist/esm/sdk/posts.js.map +1 -1
- package/dist/esm/sdk/schools.d.ts +1 -1
- package/dist/esm/sdk/schools.d.ts.map +1 -1
- package/dist/esm/sdk/users.d.ts +5 -5
- package/dist/esm/sdk/users.d.ts.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/rest-api/cypress/e2e/activity-post-endpoints.cy.js +78 -0
- package/rest-api/cypress.config.ts +1 -0
- package/rest-api/index.js +2 -0
- package/rest-api/routes/ActivityPostFunctions.js +107 -10
- package/src/funcs/categories-create.ts +14 -6
- package/src/funcs/categories-delete.ts +3 -3
- package/src/funcs/categories-get-all.ts +14 -6
- package/src/funcs/categories-update.ts +14 -7
- package/src/funcs/schools-get-all.ts +2 -2
- package/src/funcs/schools-get.ts +11 -7
- package/src/funcs/users-activities-create.ts +14 -6
- package/src/funcs/users-activities-delete.ts +3 -3
- package/src/funcs/users-activities-get-all-of-user.ts +18 -7
- package/src/funcs/users-activities-get.ts +14 -7
- package/src/funcs/users-activities-me.ts +14 -6
- package/src/funcs/users-activities-update.ts +14 -7
- package/src/funcs/users-delete.ts +3 -3
- package/src/funcs/users-friends-accept.ts +3 -3
- package/src/funcs/users-friends-list.ts +14 -7
- package/src/funcs/users-friends-pending.ts +15 -6
- package/src/funcs/users-friends-reject.ts +3 -3
- package/src/funcs/users-friends-remove.ts +3 -3
- package/src/funcs/users-friends-send-request.ts +3 -3
- package/src/funcs/users-get.ts +11 -7
- package/src/funcs/users-login.ts +11 -6
- package/src/funcs/users-me.ts +14 -6
- package/src/funcs/users-posts-delete.ts +3 -3
- package/src/funcs/users-posts-feed.ts +14 -6
- package/src/funcs/users-posts-get-by-post-id.ts +11 -7
- package/src/funcs/users-posts-get-by-user-id.ts +14 -7
- package/src/funcs/users-posts-like.ts +174 -0
- package/src/funcs/users-posts-remove-like.ts +174 -0
- package/src/funcs/users-posts-update.ts +11 -7
- package/src/funcs/users-signup.ts +8 -6
- package/src/funcs/users-update.ts +11 -7
- package/src/lib/config.ts +4 -4
- package/src/lib/files.ts +22 -0
- package/src/lib/sdks.ts +7 -5
- package/src/lib/url.ts +16 -14
- package/src/models/operations/get-feed.ts +4 -0
- package/src/models/operations/get-post-by-id.ts +4 -0
- package/src/models/operations/get-user-posts.ts +4 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/like-post.ts +28 -0
- package/src/models/operations/unlike-post.ts +30 -0
- package/src/sdk/activities.ts +5 -5
- package/src/sdk/categories.ts +3 -3
- package/src/sdk/friends.ts +2 -2
- package/src/sdk/posts.ts +34 -4
- package/src/sdk/schools.ts +1 -1
- package/src/sdk/users.ts +5 -5
|
@@ -235,4 +235,82 @@ describe('User Activity Posts Endpoints Unit Tests', () => {
|
|
|
235
235
|
expect(response.status).to.equal(200, "Deleting post by ID should have succeeded; got non-success code instead!");
|
|
236
236
|
});
|
|
237
237
|
});
|
|
238
|
+
|
|
239
|
+
// Liking post
|
|
240
|
+
it('Liking post by ID should fail due to invalid bearer token', () => {
|
|
241
|
+
cy.request({
|
|
242
|
+
failOnStatusCode: false,
|
|
243
|
+
method: "patch",
|
|
244
|
+
url: "posts/1/like",
|
|
245
|
+
headers: {
|
|
246
|
+
"Authorization": "Bearer invalidBearer"
|
|
247
|
+
},
|
|
248
|
+
}).then(response => {
|
|
249
|
+
expect(response.status).to.equal(401, "Liking post by ID should have failed with HTTP 401; different code was found instead!");
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it('Liking post by ID should fail due to invalid post ID', () => {
|
|
254
|
+
cy.request({
|
|
255
|
+
failOnStatusCode: false,
|
|
256
|
+
method: "patch",
|
|
257
|
+
url: "posts/99/like",
|
|
258
|
+
headers: {
|
|
259
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
260
|
+
},
|
|
261
|
+
}).then(response => {
|
|
262
|
+
expect(response.status).to.equal(404, "Liking post by ID should have failed with HTTP 404; different code was found instead!");
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('Liking post should succeed', () => {
|
|
267
|
+
cy.request({
|
|
268
|
+
method: "patch",
|
|
269
|
+
url: "posts/1/like",
|
|
270
|
+
headers: {
|
|
271
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
272
|
+
},
|
|
273
|
+
}).then(response => {
|
|
274
|
+
expect(response.status).to.equal(200, "Liking post by ID should have succeeded; got non-success code instead!");
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
// Unliking post
|
|
279
|
+
it('Unliking post by ID should fail due to invalid bearer token', () => {
|
|
280
|
+
cy.request({
|
|
281
|
+
failOnStatusCode: false,
|
|
282
|
+
method: "delete",
|
|
283
|
+
url: "posts/1/like",
|
|
284
|
+
headers: {
|
|
285
|
+
"Authorization": "Bearer invalidBearer"
|
|
286
|
+
},
|
|
287
|
+
}).then(response => {
|
|
288
|
+
expect(response.status).to.equal(401, "Unliking post by ID should have failed with HTTP 404; different code was found instead!");
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('Unliking post by ID should fail due to invalid post ID', () => {
|
|
293
|
+
cy.request({
|
|
294
|
+
failOnStatusCode: false,
|
|
295
|
+
method: "delete",
|
|
296
|
+
url: "posts/99/like",
|
|
297
|
+
headers: {
|
|
298
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
299
|
+
},
|
|
300
|
+
}).then(response => {
|
|
301
|
+
expect(response.status).to.equal(404, "Unliking post by ID should have failed with HTTP 404; different code was found instead!");
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
it('Unliking post should succeed', () => {
|
|
306
|
+
cy.request({
|
|
307
|
+
method: "delete",
|
|
308
|
+
url: "posts/1/like",
|
|
309
|
+
headers: {
|
|
310
|
+
"Authorization": "Bearer 9d2272fd048bfeedda522935244fc4450fb61a9da6f7b7cea529c6c11033e9efee6b140b6e4b372f0c81a07a6e040be5150f506922e8a5c47719f7be2c707252"
|
|
311
|
+
},
|
|
312
|
+
}).then(response => {
|
|
313
|
+
expect(response.status).to.equal(200, "Unliking post by ID should have succeeded; got non-success code instead!");
|
|
314
|
+
});
|
|
315
|
+
});
|
|
238
316
|
});
|
|
@@ -50,6 +50,7 @@ export default defineConfig({
|
|
|
50
50
|
|
|
51
51
|
async reseedUserActivityPostsTable() {
|
|
52
52
|
return await prisma.$transaction([
|
|
53
|
+
prisma.likes.deleteMany({}),
|
|
53
54
|
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...');`,
|
|
54
55
|
prisma.$executeRaw`REPLACE INTO User_Activity_Posts (post_id, user_id, category_name, activity_id, post_date, post_status, caption) VALUES (2, 3, 'Professional', 1, '2026-02-28 22:15:02', 'public', 'This is a test post! Nothing much going on here...');`
|
|
55
56
|
])
|
package/rest-api/index.js
CHANGED
|
@@ -44,6 +44,8 @@ const handler = {
|
|
|
44
44
|
getPostById: ActivityPostFunctions.getPostByIdHandler,
|
|
45
45
|
updatePost: ActivityPostFunctions.updatePostHandler,
|
|
46
46
|
deletePost: ActivityPostFunctions.deletePostHandler,
|
|
47
|
+
likePost: ActivityPostFunctions.likePostHandler,
|
|
48
|
+
unlikePost: ActivityPostFunctions.unlikePostHandler,
|
|
47
49
|
listFriends: FriendFunctions.listFriendsHandler,
|
|
48
50
|
sendFriendRequest: FriendFunctions.sendFriendRequestHandler,
|
|
49
51
|
acceptFriendRequest: FriendFunctions.acceptFriendRequestHandler,
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { getUserAuthInfo, areUsersFriends } from "../lib/users.js";
|
|
2
2
|
|
|
3
|
+
//! Note: this function safely assumes that
|
|
4
|
+
// a valid post with `postId` exists in the DB
|
|
5
|
+
async function getLikesForPost(postId, prisma) {
|
|
6
|
+
return await prisma.Likes.count({
|
|
7
|
+
where: {
|
|
8
|
+
post_id: postId
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function userHasAlreadyLikedPost(postId, userId, prisma) {
|
|
14
|
+
return (await prisma.Likes.findFirst({
|
|
15
|
+
where: {
|
|
16
|
+
post_id: postId,
|
|
17
|
+
user_id: userId
|
|
18
|
+
},
|
|
19
|
+
select: {
|
|
20
|
+
like_id: true
|
|
21
|
+
}
|
|
22
|
+
})) !== null;
|
|
23
|
+
}
|
|
24
|
+
|
|
3
25
|
export async function getUserPostsHandler(request, reply, fastify) {
|
|
4
26
|
const accessToken = (request.headers.authorization ?? "").substring(7)
|
|
5
27
|
const userInfo = await getUserAuthInfo(fastify.prisma, accessToken);
|
|
@@ -43,15 +65,17 @@ export async function getUserPostsHandler(request, reply, fastify) {
|
|
|
43
65
|
}
|
|
44
66
|
});
|
|
45
67
|
|
|
46
|
-
return userPosts.map(post => ({
|
|
68
|
+
return await Promise.all(userPosts.map(async post => ({
|
|
47
69
|
postId: post.post_id,
|
|
48
70
|
userId: userInfo.user_id,
|
|
49
71
|
categoryName: post.category_name,
|
|
50
72
|
activityId: post.activity_id,
|
|
51
73
|
postDate: post.post_date,
|
|
52
74
|
postStatus: post.post_status,
|
|
53
|
-
caption: post.caption
|
|
54
|
-
|
|
75
|
+
caption: post.caption,
|
|
76
|
+
likes: await getLikesForPost(post.post_id, fastify.prisma),
|
|
77
|
+
likedByCurrentUser: userHasAlreadyLikedPost(post.post_id, userInfo.user_id, fastify.prisma)
|
|
78
|
+
})));
|
|
55
79
|
}
|
|
56
80
|
|
|
57
81
|
export async function getFeedHandler(request, reply, fastify) {
|
|
@@ -97,7 +121,7 @@ export async function getFeedHandler(request, reply, fastify) {
|
|
|
97
121
|
const posts = await fastify.prisma.User_Activity_Posts.findMany({
|
|
98
122
|
where: {
|
|
99
123
|
user_id: {
|
|
100
|
-
in: friendIds
|
|
124
|
+
in: [...friendIds, userInfo.user_id]
|
|
101
125
|
}
|
|
102
126
|
},
|
|
103
127
|
select: {
|
|
@@ -121,21 +145,23 @@ export async function getFeedHandler(request, reply, fastify) {
|
|
|
121
145
|
}
|
|
122
146
|
},
|
|
123
147
|
orderBy: {
|
|
124
|
-
|
|
148
|
+
post_id: "asc"
|
|
125
149
|
},
|
|
126
150
|
take: limit,
|
|
127
151
|
cursor: lastPostId !== -1 ? { post_id: lastPostId } : undefined,
|
|
128
152
|
skip: lastPostId !== -1 ? 1 : undefined
|
|
129
153
|
});
|
|
130
154
|
|
|
131
|
-
return posts.map(post => ({
|
|
155
|
+
return await Promise.all(posts.sort((a, b) => b.post_id - a.post_id).map(async post => ({
|
|
132
156
|
postId: post.post_id,
|
|
133
157
|
postDate: post.post_date,
|
|
134
158
|
postStatus: post.post_status,
|
|
135
159
|
userId: post.users.user_id,
|
|
136
160
|
categoryName: post.Category.category_name,
|
|
137
|
-
activityId: post.User_Activity.activity_id
|
|
138
|
-
|
|
161
|
+
activityId: post.User_Activity.activity_id,
|
|
162
|
+
likes: await getLikesForPost(post.post_id, fastify.prisma),
|
|
163
|
+
likedByCurrentUser: userHasAlreadyLikedPost(post.post_id, userInfo.user_id, fastify.prisma)
|
|
164
|
+
})));
|
|
139
165
|
}
|
|
140
166
|
|
|
141
167
|
export async function getPostByIdHandler(request, reply, fastify) {
|
|
@@ -181,7 +207,9 @@ export async function getPostByIdHandler(request, reply, fastify) {
|
|
|
181
207
|
activityId: post.activity_id,
|
|
182
208
|
postDate: post.post_date,
|
|
183
209
|
postStatus: post.post_status,
|
|
184
|
-
caption: post.caption
|
|
210
|
+
caption: post.caption,
|
|
211
|
+
likes: await getLikesForPost(post.post_id, fastify.prisma),
|
|
212
|
+
likedByCurrentUser: userHasAlreadyLikedPost(post.post_id, userInfo.user_id, fastify.prisma)
|
|
185
213
|
};
|
|
186
214
|
}
|
|
187
215
|
|
|
@@ -276,4 +304,73 @@ export async function deletePostHandler(request, reply, fastify) {
|
|
|
276
304
|
post_id: request.params.id
|
|
277
305
|
}
|
|
278
306
|
});
|
|
279
|
-
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export async function likePostHandler(request, reply, fastify) {
|
|
310
|
+
const accessToken = (request.headers.authorization ?? "").substring(7)
|
|
311
|
+
const userInfo = await getUserAuthInfo(fastify.prisma, accessToken);
|
|
312
|
+
|
|
313
|
+
if (userInfo === null) {
|
|
314
|
+
reply.status(401);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const postCheck = await fastify.prisma.User_Activity_Posts.findFirst({
|
|
319
|
+
where: {
|
|
320
|
+
post_id: request.params.id
|
|
321
|
+
},
|
|
322
|
+
select: {
|
|
323
|
+
user_id: true
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
if (postCheck === null) {
|
|
328
|
+
reply.status(404);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// like only if user hasn't liked the post yet
|
|
333
|
+
if (!(await userHasAlreadyLikedPost(request.params.id, userInfo.user_id, fastify.prisma))) {
|
|
334
|
+
await fastify.prisma.Likes.create({
|
|
335
|
+
data: {
|
|
336
|
+
post_id: request.params.id,
|
|
337
|
+
user_id: userInfo.user_id
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export async function unlikePostHandler(request, reply, fastify) {
|
|
344
|
+
const accessToken = (request.headers.authorization ?? "").substring(7)
|
|
345
|
+
const userInfo = await getUserAuthInfo(fastify.prisma, accessToken);
|
|
346
|
+
|
|
347
|
+
if (userInfo === null) {
|
|
348
|
+
reply.status(401);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const postCheck = await fastify.prisma.User_Activity_Posts.findFirst({
|
|
353
|
+
where: {
|
|
354
|
+
post_id: request.params.id
|
|
355
|
+
},
|
|
356
|
+
select: {
|
|
357
|
+
user_id: true
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
if (postCheck === null) {
|
|
362
|
+
reply.status(404);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
try {
|
|
367
|
+
await fastify.prisma.Likes.delete({
|
|
368
|
+
where: {
|
|
369
|
+
post_id_user_id: {
|
|
370
|
+
user_id: userInfo.user_id,
|
|
371
|
+
post_id: request.params.id
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
} catch{} // will except if no record found to delete, but this is normal if the user hasn't liked the post
|
|
376
|
+
}
|
|
@@ -24,6 +24,7 @@ import { SenseiProductivityError } from "../models/errors/sensei-productivity-er
|
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
|
+
import * as types$ from "../types/primitives.js";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Create a new category (school admins only)
|
|
@@ -34,7 +35,7 @@ export function categoriesCreate(
|
|
|
34
35
|
options?: RequestOptions,
|
|
35
36
|
): APIPromise<
|
|
36
37
|
Result<
|
|
37
|
-
operations.CreateCategoryResponse,
|
|
38
|
+
operations.CreateCategoryResponse | undefined,
|
|
38
39
|
| SenseiProductivityError
|
|
39
40
|
| ResponseValidationError
|
|
40
41
|
| ConnectionError
|
|
@@ -59,7 +60,7 @@ async function $do(
|
|
|
59
60
|
): Promise<
|
|
60
61
|
[
|
|
61
62
|
Result<
|
|
62
|
-
operations.CreateCategoryResponse,
|
|
63
|
+
operations.CreateCategoryResponse | undefined,
|
|
63
64
|
| SenseiProductivityError
|
|
64
65
|
| ResponseValidationError
|
|
65
66
|
| ConnectionError
|
|
@@ -136,7 +137,7 @@ async function $do(
|
|
|
136
137
|
|
|
137
138
|
const doResult = await client._do(req, {
|
|
138
139
|
context,
|
|
139
|
-
errorCodes: ["
|
|
140
|
+
errorCodes: ["429", "5XX"],
|
|
140
141
|
retryConfig: context.retryConfig,
|
|
141
142
|
retryCodes: context.retryCodes,
|
|
142
143
|
});
|
|
@@ -146,7 +147,7 @@ async function $do(
|
|
|
146
147
|
const response = doResult.value;
|
|
147
148
|
|
|
148
149
|
const [result] = await M.match<
|
|
149
|
-
operations.CreateCategoryResponse,
|
|
150
|
+
operations.CreateCategoryResponse | undefined,
|
|
150
151
|
| SenseiProductivityError
|
|
151
152
|
| ResponseValidationError
|
|
152
153
|
| ConnectionError
|
|
@@ -156,8 +157,15 @@ async function $do(
|
|
|
156
157
|
| UnexpectedClientError
|
|
157
158
|
| SDKValidationError
|
|
158
159
|
>(
|
|
159
|
-
M.json(
|
|
160
|
-
|
|
160
|
+
M.json(
|
|
161
|
+
201,
|
|
162
|
+
types$.optional(operations.CreateCategoryResponse$inboundSchema),
|
|
163
|
+
),
|
|
164
|
+
M.nil(
|
|
165
|
+
[400, 401, 403],
|
|
166
|
+
types$.optional(operations.CreateCategoryResponse$inboundSchema),
|
|
167
|
+
),
|
|
168
|
+
M.fail(429),
|
|
161
169
|
M.fail("5XX"),
|
|
162
170
|
)(response, req);
|
|
163
171
|
if (!result.ok) {
|
|
@@ -89,7 +89,6 @@ async function $do(
|
|
|
89
89
|
charEncoding: "percent",
|
|
90
90
|
}),
|
|
91
91
|
};
|
|
92
|
-
|
|
93
92
|
const path = pathToFunc("/api/v1/categories/{id}")(pathParams);
|
|
94
93
|
|
|
95
94
|
const headers = new Headers(compactMap({
|
|
@@ -142,7 +141,7 @@ async function $do(
|
|
|
142
141
|
|
|
143
142
|
const doResult = await client._do(req, {
|
|
144
143
|
context,
|
|
145
|
-
errorCodes: ["
|
|
144
|
+
errorCodes: ["429", "5XX"],
|
|
146
145
|
retryConfig: context.retryConfig,
|
|
147
146
|
retryCodes: context.retryCodes,
|
|
148
147
|
});
|
|
@@ -163,7 +162,8 @@ async function $do(
|
|
|
163
162
|
| SDKValidationError
|
|
164
163
|
>(
|
|
165
164
|
M.nil(200, z.void()),
|
|
166
|
-
M.
|
|
165
|
+
M.nil([401, 403, 404], z.void()),
|
|
166
|
+
M.fail(429),
|
|
167
167
|
M.fail("5XX"),
|
|
168
168
|
)(response, req);
|
|
169
169
|
if (!result.ok) {
|
|
@@ -22,6 +22,7 @@ import { SenseiProductivityError } from "../models/errors/sensei-productivity-er
|
|
|
22
22
|
import * as operations from "../models/operations/index.js";
|
|
23
23
|
import { APICall, APIPromise } from "../types/async.js";
|
|
24
24
|
import { Result } from "../types/fp.js";
|
|
25
|
+
import * as types$ from "../types/primitives.js";
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* List all categories
|
|
@@ -31,7 +32,7 @@ export function categoriesGetAll(
|
|
|
31
32
|
options?: RequestOptions,
|
|
32
33
|
): APIPromise<
|
|
33
34
|
Result<
|
|
34
|
-
Array<operations.ListCategoriesResponse
|
|
35
|
+
Array<operations.ListCategoriesResponse> | undefined,
|
|
35
36
|
| SenseiProductivityError
|
|
36
37
|
| ResponseValidationError
|
|
37
38
|
| ConnectionError
|
|
@@ -54,7 +55,7 @@ async function $do(
|
|
|
54
55
|
): Promise<
|
|
55
56
|
[
|
|
56
57
|
Result<
|
|
57
|
-
Array<operations.ListCategoriesResponse
|
|
58
|
+
Array<operations.ListCategoriesResponse> | undefined,
|
|
58
59
|
| SenseiProductivityError
|
|
59
60
|
| ResponseValidationError
|
|
60
61
|
| ConnectionError
|
|
@@ -118,7 +119,7 @@ async function $do(
|
|
|
118
119
|
|
|
119
120
|
const doResult = await client._do(req, {
|
|
120
121
|
context,
|
|
121
|
-
errorCodes: ["
|
|
122
|
+
errorCodes: ["429", "5XX"],
|
|
122
123
|
retryConfig: context.retryConfig,
|
|
123
124
|
retryCodes: context.retryCodes,
|
|
124
125
|
});
|
|
@@ -128,7 +129,7 @@ async function $do(
|
|
|
128
129
|
const response = doResult.value;
|
|
129
130
|
|
|
130
131
|
const [result] = await M.match<
|
|
131
|
-
Array<operations.ListCategoriesResponse
|
|
132
|
+
Array<operations.ListCategoriesResponse> | undefined,
|
|
132
133
|
| SenseiProductivityError
|
|
133
134
|
| ResponseValidationError
|
|
134
135
|
| ConnectionError
|
|
@@ -138,8 +139,15 @@ async function $do(
|
|
|
138
139
|
| UnexpectedClientError
|
|
139
140
|
| SDKValidationError
|
|
140
141
|
>(
|
|
141
|
-
M.json(
|
|
142
|
-
|
|
142
|
+
M.json(
|
|
143
|
+
200,
|
|
144
|
+
types$.optional(z.array(operations.ListCategoriesResponse$inboundSchema)),
|
|
145
|
+
),
|
|
146
|
+
M.nil(
|
|
147
|
+
401,
|
|
148
|
+
types$.optional(z.array(operations.ListCategoriesResponse$inboundSchema)),
|
|
149
|
+
),
|
|
150
|
+
M.fail(429),
|
|
143
151
|
M.fail("5XX"),
|
|
144
152
|
)(response, req);
|
|
145
153
|
if (!result.ok) {
|
|
@@ -24,6 +24,7 @@ import { SenseiProductivityError } from "../models/errors/sensei-productivity-er
|
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
|
+
import * as types$ from "../types/primitives.js";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Update a category (school admins only)
|
|
@@ -34,7 +35,7 @@ export function categoriesUpdate(
|
|
|
34
35
|
options?: RequestOptions,
|
|
35
36
|
): APIPromise<
|
|
36
37
|
Result<
|
|
37
|
-
operations.UpdateCategoryResponse,
|
|
38
|
+
operations.UpdateCategoryResponse | undefined,
|
|
38
39
|
| SenseiProductivityError
|
|
39
40
|
| ResponseValidationError
|
|
40
41
|
| ConnectionError
|
|
@@ -59,7 +60,7 @@ async function $do(
|
|
|
59
60
|
): Promise<
|
|
60
61
|
[
|
|
61
62
|
Result<
|
|
62
|
-
operations.UpdateCategoryResponse,
|
|
63
|
+
operations.UpdateCategoryResponse | undefined,
|
|
63
64
|
| SenseiProductivityError
|
|
64
65
|
| ResponseValidationError
|
|
65
66
|
| ConnectionError
|
|
@@ -89,7 +90,6 @@ async function $do(
|
|
|
89
90
|
charEncoding: "percent",
|
|
90
91
|
}),
|
|
91
92
|
};
|
|
92
|
-
|
|
93
93
|
const path = pathToFunc("/api/v1/categories/{id}")(pathParams);
|
|
94
94
|
|
|
95
95
|
const headers = new Headers(compactMap({
|
|
@@ -143,7 +143,7 @@ async function $do(
|
|
|
143
143
|
|
|
144
144
|
const doResult = await client._do(req, {
|
|
145
145
|
context,
|
|
146
|
-
errorCodes: ["
|
|
146
|
+
errorCodes: ["429", "5XX"],
|
|
147
147
|
retryConfig: context.retryConfig,
|
|
148
148
|
retryCodes: context.retryCodes,
|
|
149
149
|
});
|
|
@@ -153,7 +153,7 @@ async function $do(
|
|
|
153
153
|
const response = doResult.value;
|
|
154
154
|
|
|
155
155
|
const [result] = await M.match<
|
|
156
|
-
operations.UpdateCategoryResponse,
|
|
156
|
+
operations.UpdateCategoryResponse | undefined,
|
|
157
157
|
| SenseiProductivityError
|
|
158
158
|
| ResponseValidationError
|
|
159
159
|
| ConnectionError
|
|
@@ -163,8 +163,15 @@ async function $do(
|
|
|
163
163
|
| UnexpectedClientError
|
|
164
164
|
| SDKValidationError
|
|
165
165
|
>(
|
|
166
|
-
M.json(
|
|
167
|
-
|
|
166
|
+
M.json(
|
|
167
|
+
200,
|
|
168
|
+
types$.optional(operations.UpdateCategoryResponse$inboundSchema),
|
|
169
|
+
),
|
|
170
|
+
M.nil(
|
|
171
|
+
[400, 401, 403, 404],
|
|
172
|
+
types$.optional(operations.UpdateCategoryResponse$inboundSchema),
|
|
173
|
+
),
|
|
174
|
+
M.fail(429),
|
|
168
175
|
M.fail("5XX"),
|
|
169
176
|
)(response, req);
|
|
170
177
|
if (!result.ok) {
|
|
@@ -118,7 +118,7 @@ async function $do(
|
|
|
118
118
|
|
|
119
119
|
const doResult = await client._do(req, {
|
|
120
120
|
context,
|
|
121
|
-
errorCodes: ["
|
|
121
|
+
errorCodes: ["429", "5XX"],
|
|
122
122
|
retryConfig: context.retryConfig,
|
|
123
123
|
retryCodes: context.retryCodes,
|
|
124
124
|
});
|
|
@@ -139,7 +139,7 @@ async function $do(
|
|
|
139
139
|
| SDKValidationError
|
|
140
140
|
>(
|
|
141
141
|
M.json(200, z.array(operations.ListSchoolsResponse$inboundSchema)),
|
|
142
|
-
M.fail(
|
|
142
|
+
M.fail(429),
|
|
143
143
|
M.fail("5XX"),
|
|
144
144
|
)(response, req);
|
|
145
145
|
if (!result.ok) {
|
package/src/funcs/schools-get.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { SenseiProductivityError } from "../models/errors/sensei-productivity-er
|
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
|
+
import * as types$ from "../types/primitives.js";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Get a school's details by ID
|
|
@@ -34,7 +35,7 @@ export function schoolsGet(
|
|
|
34
35
|
options?: RequestOptions,
|
|
35
36
|
): APIPromise<
|
|
36
37
|
Result<
|
|
37
|
-
operations.GetSchoolByIdResponse,
|
|
38
|
+
operations.GetSchoolByIdResponse | undefined,
|
|
38
39
|
| SenseiProductivityError
|
|
39
40
|
| ResponseValidationError
|
|
40
41
|
| ConnectionError
|
|
@@ -59,7 +60,7 @@ async function $do(
|
|
|
59
60
|
): Promise<
|
|
60
61
|
[
|
|
61
62
|
Result<
|
|
62
|
-
operations.GetSchoolByIdResponse,
|
|
63
|
+
operations.GetSchoolByIdResponse | undefined,
|
|
63
64
|
| SenseiProductivityError
|
|
64
65
|
| ResponseValidationError
|
|
65
66
|
| ConnectionError
|
|
@@ -89,7 +90,6 @@ async function $do(
|
|
|
89
90
|
charEncoding: "percent",
|
|
90
91
|
}),
|
|
91
92
|
};
|
|
92
|
-
|
|
93
93
|
const path = pathToFunc("/api/v1/schools/{id}")(pathParams);
|
|
94
94
|
|
|
95
95
|
const headers = new Headers(compactMap({
|
|
@@ -142,7 +142,7 @@ async function $do(
|
|
|
142
142
|
|
|
143
143
|
const doResult = await client._do(req, {
|
|
144
144
|
context,
|
|
145
|
-
errorCodes: ["
|
|
145
|
+
errorCodes: ["429", "5XX"],
|
|
146
146
|
retryConfig: context.retryConfig,
|
|
147
147
|
retryCodes: context.retryCodes,
|
|
148
148
|
});
|
|
@@ -152,7 +152,7 @@ async function $do(
|
|
|
152
152
|
const response = doResult.value;
|
|
153
153
|
|
|
154
154
|
const [result] = await M.match<
|
|
155
|
-
operations.GetSchoolByIdResponse,
|
|
155
|
+
operations.GetSchoolByIdResponse | undefined,
|
|
156
156
|
| SenseiProductivityError
|
|
157
157
|
| ResponseValidationError
|
|
158
158
|
| ConnectionError
|
|
@@ -162,8 +162,12 @@ async function $do(
|
|
|
162
162
|
| UnexpectedClientError
|
|
163
163
|
| SDKValidationError
|
|
164
164
|
>(
|
|
165
|
-
M.json(
|
|
166
|
-
|
|
165
|
+
M.json(
|
|
166
|
+
200,
|
|
167
|
+
types$.optional(operations.GetSchoolByIdResponse$inboundSchema),
|
|
168
|
+
),
|
|
169
|
+
M.nil(404, types$.optional(operations.GetSchoolByIdResponse$inboundSchema)),
|
|
170
|
+
M.fail(429),
|
|
167
171
|
M.fail("5XX"),
|
|
168
172
|
)(response, req);
|
|
169
173
|
if (!result.ok) {
|
|
@@ -24,6 +24,7 @@ import { SenseiProductivityError } from "../models/errors/sensei-productivity-er
|
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
|
+
import * as types$ from "../types/primitives.js";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Create a new activity
|
|
@@ -34,7 +35,7 @@ export function usersActivitiesCreate(
|
|
|
34
35
|
options?: RequestOptions,
|
|
35
36
|
): APIPromise<
|
|
36
37
|
Result<
|
|
37
|
-
operations.CreateActivityResponse,
|
|
38
|
+
operations.CreateActivityResponse | undefined,
|
|
38
39
|
| SenseiProductivityError
|
|
39
40
|
| ResponseValidationError
|
|
40
41
|
| ConnectionError
|
|
@@ -59,7 +60,7 @@ async function $do(
|
|
|
59
60
|
): Promise<
|
|
60
61
|
[
|
|
61
62
|
Result<
|
|
62
|
-
operations.CreateActivityResponse,
|
|
63
|
+
operations.CreateActivityResponse | undefined,
|
|
63
64
|
| SenseiProductivityError
|
|
64
65
|
| ResponseValidationError
|
|
65
66
|
| ConnectionError
|
|
@@ -136,7 +137,7 @@ async function $do(
|
|
|
136
137
|
|
|
137
138
|
const doResult = await client._do(req, {
|
|
138
139
|
context,
|
|
139
|
-
errorCodes: ["
|
|
140
|
+
errorCodes: ["429", "5XX"],
|
|
140
141
|
retryConfig: context.retryConfig,
|
|
141
142
|
retryCodes: context.retryCodes,
|
|
142
143
|
});
|
|
@@ -146,7 +147,7 @@ async function $do(
|
|
|
146
147
|
const response = doResult.value;
|
|
147
148
|
|
|
148
149
|
const [result] = await M.match<
|
|
149
|
-
operations.CreateActivityResponse,
|
|
150
|
+
operations.CreateActivityResponse | undefined,
|
|
150
151
|
| SenseiProductivityError
|
|
151
152
|
| ResponseValidationError
|
|
152
153
|
| ConnectionError
|
|
@@ -156,8 +157,15 @@ async function $do(
|
|
|
156
157
|
| UnexpectedClientError
|
|
157
158
|
| SDKValidationError
|
|
158
159
|
>(
|
|
159
|
-
M.json(
|
|
160
|
-
|
|
160
|
+
M.json(
|
|
161
|
+
201,
|
|
162
|
+
types$.optional(operations.CreateActivityResponse$inboundSchema),
|
|
163
|
+
),
|
|
164
|
+
M.nil(
|
|
165
|
+
[400, 401],
|
|
166
|
+
types$.optional(operations.CreateActivityResponse$inboundSchema),
|
|
167
|
+
),
|
|
168
|
+
M.fail(429),
|
|
161
169
|
M.fail("5XX"),
|
|
162
170
|
)(response, req);
|
|
163
171
|
if (!result.ok) {
|
|
@@ -89,7 +89,6 @@ async function $do(
|
|
|
89
89
|
charEncoding: "percent",
|
|
90
90
|
}),
|
|
91
91
|
};
|
|
92
|
-
|
|
93
92
|
const path = pathToFunc("/api/v1/activities/{id}")(pathParams);
|
|
94
93
|
|
|
95
94
|
const headers = new Headers(compactMap({
|
|
@@ -142,7 +141,7 @@ async function $do(
|
|
|
142
141
|
|
|
143
142
|
const doResult = await client._do(req, {
|
|
144
143
|
context,
|
|
145
|
-
errorCodes: ["
|
|
144
|
+
errorCodes: ["429", "5XX"],
|
|
146
145
|
retryConfig: context.retryConfig,
|
|
147
146
|
retryCodes: context.retryCodes,
|
|
148
147
|
});
|
|
@@ -163,7 +162,8 @@ async function $do(
|
|
|
163
162
|
| SDKValidationError
|
|
164
163
|
>(
|
|
165
164
|
M.nil(200, z.void()),
|
|
166
|
-
M.
|
|
165
|
+
M.nil([401, 403, 404], z.void()),
|
|
166
|
+
M.fail(429),
|
|
167
167
|
M.fail("5XX"),
|
|
168
168
|
)(response, req);
|
|
169
169
|
if (!result.ok) {
|