@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.
Files changed (366) hide show
  1. package/README.md +4 -0
  2. package/dist/commonjs/funcs/categories-create.d.ts +1 -1
  3. package/dist/commonjs/funcs/categories-create.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/categories-create.js +3 -2
  5. package/dist/commonjs/funcs/categories-create.js.map +1 -1
  6. package/dist/commonjs/funcs/categories-delete.js +2 -2
  7. package/dist/commonjs/funcs/categories-delete.js.map +1 -1
  8. package/dist/commonjs/funcs/categories-get-all.d.ts +1 -1
  9. package/dist/commonjs/funcs/categories-get-all.d.ts.map +1 -1
  10. package/dist/commonjs/funcs/categories-get-all.js +3 -2
  11. package/dist/commonjs/funcs/categories-get-all.js.map +1 -1
  12. package/dist/commonjs/funcs/categories-update.d.ts +1 -1
  13. package/dist/commonjs/funcs/categories-update.d.ts.map +1 -1
  14. package/dist/commonjs/funcs/categories-update.js +3 -2
  15. package/dist/commonjs/funcs/categories-update.js.map +1 -1
  16. package/dist/commonjs/funcs/schools-get-all.js +2 -2
  17. package/dist/commonjs/funcs/schools-get-all.js.map +1 -1
  18. package/dist/commonjs/funcs/schools-get.d.ts +1 -1
  19. package/dist/commonjs/funcs/schools-get.d.ts.map +1 -1
  20. package/dist/commonjs/funcs/schools-get.js +3 -2
  21. package/dist/commonjs/funcs/schools-get.js.map +1 -1
  22. package/dist/commonjs/funcs/users-activities-create.d.ts +1 -1
  23. package/dist/commonjs/funcs/users-activities-create.d.ts.map +1 -1
  24. package/dist/commonjs/funcs/users-activities-create.js +3 -2
  25. package/dist/commonjs/funcs/users-activities-create.js.map +1 -1
  26. package/dist/commonjs/funcs/users-activities-delete.js +2 -2
  27. package/dist/commonjs/funcs/users-activities-delete.js.map +1 -1
  28. package/dist/commonjs/funcs/users-activities-get-all-of-user.d.ts +1 -1
  29. package/dist/commonjs/funcs/users-activities-get-all-of-user.d.ts.map +1 -1
  30. package/dist/commonjs/funcs/users-activities-get-all-of-user.js +3 -2
  31. package/dist/commonjs/funcs/users-activities-get-all-of-user.js.map +1 -1
  32. package/dist/commonjs/funcs/users-activities-get.d.ts +1 -1
  33. package/dist/commonjs/funcs/users-activities-get.d.ts.map +1 -1
  34. package/dist/commonjs/funcs/users-activities-get.js +3 -2
  35. package/dist/commonjs/funcs/users-activities-get.js.map +1 -1
  36. package/dist/commonjs/funcs/users-activities-me.d.ts +1 -1
  37. package/dist/commonjs/funcs/users-activities-me.d.ts.map +1 -1
  38. package/dist/commonjs/funcs/users-activities-me.js +3 -2
  39. package/dist/commonjs/funcs/users-activities-me.js.map +1 -1
  40. package/dist/commonjs/funcs/users-activities-update.d.ts +1 -1
  41. package/dist/commonjs/funcs/users-activities-update.d.ts.map +1 -1
  42. package/dist/commonjs/funcs/users-activities-update.js +3 -2
  43. package/dist/commonjs/funcs/users-activities-update.js.map +1 -1
  44. package/dist/commonjs/funcs/users-delete.js +2 -2
  45. package/dist/commonjs/funcs/users-delete.js.map +1 -1
  46. package/dist/commonjs/funcs/users-friends-accept.js +2 -2
  47. package/dist/commonjs/funcs/users-friends-accept.js.map +1 -1
  48. package/dist/commonjs/funcs/users-friends-list.d.ts +1 -1
  49. package/dist/commonjs/funcs/users-friends-list.d.ts.map +1 -1
  50. package/dist/commonjs/funcs/users-friends-list.js +3 -2
  51. package/dist/commonjs/funcs/users-friends-list.js.map +1 -1
  52. package/dist/commonjs/funcs/users-friends-pending.d.ts +1 -1
  53. package/dist/commonjs/funcs/users-friends-pending.d.ts.map +1 -1
  54. package/dist/commonjs/funcs/users-friends-pending.js +3 -2
  55. package/dist/commonjs/funcs/users-friends-pending.js.map +1 -1
  56. package/dist/commonjs/funcs/users-friends-reject.js +2 -2
  57. package/dist/commonjs/funcs/users-friends-reject.js.map +1 -1
  58. package/dist/commonjs/funcs/users-friends-remove.js +2 -2
  59. package/dist/commonjs/funcs/users-friends-remove.js.map +1 -1
  60. package/dist/commonjs/funcs/users-friends-send-request.js +2 -2
  61. package/dist/commonjs/funcs/users-friends-send-request.js.map +1 -1
  62. package/dist/commonjs/funcs/users-get.d.ts +1 -1
  63. package/dist/commonjs/funcs/users-get.d.ts.map +1 -1
  64. package/dist/commonjs/funcs/users-get.js +3 -2
  65. package/dist/commonjs/funcs/users-get.js.map +1 -1
  66. package/dist/commonjs/funcs/users-login.d.ts +1 -1
  67. package/dist/commonjs/funcs/users-login.d.ts.map +1 -1
  68. package/dist/commonjs/funcs/users-login.js +3 -2
  69. package/dist/commonjs/funcs/users-login.js.map +1 -1
  70. package/dist/commonjs/funcs/users-me.d.ts +1 -1
  71. package/dist/commonjs/funcs/users-me.d.ts.map +1 -1
  72. package/dist/commonjs/funcs/users-me.js +3 -2
  73. package/dist/commonjs/funcs/users-me.js.map +1 -1
  74. package/dist/commonjs/funcs/users-posts-delete.js +2 -2
  75. package/dist/commonjs/funcs/users-posts-delete.js.map +1 -1
  76. package/dist/commonjs/funcs/users-posts-feed.d.ts +1 -1
  77. package/dist/commonjs/funcs/users-posts-feed.d.ts.map +1 -1
  78. package/dist/commonjs/funcs/users-posts-feed.js +3 -2
  79. package/dist/commonjs/funcs/users-posts-feed.js.map +1 -1
  80. package/dist/commonjs/funcs/users-posts-get-by-post-id.d.ts +1 -1
  81. package/dist/commonjs/funcs/users-posts-get-by-post-id.d.ts.map +1 -1
  82. package/dist/commonjs/funcs/users-posts-get-by-post-id.js +3 -2
  83. package/dist/commonjs/funcs/users-posts-get-by-post-id.js.map +1 -1
  84. package/dist/commonjs/funcs/users-posts-get-by-user-id.d.ts +1 -1
  85. package/dist/commonjs/funcs/users-posts-get-by-user-id.d.ts.map +1 -1
  86. package/dist/commonjs/funcs/users-posts-get-by-user-id.js +3 -2
  87. package/dist/commonjs/funcs/users-posts-get-by-user-id.js.map +1 -1
  88. package/dist/commonjs/funcs/users-posts-like.d.ts +14 -0
  89. package/dist/commonjs/funcs/users-posts-like.d.ts.map +1 -0
  90. package/dist/commonjs/funcs/users-posts-like.js +127 -0
  91. package/dist/commonjs/funcs/users-posts-like.js.map +1 -0
  92. package/dist/commonjs/funcs/users-posts-remove-like.d.ts +14 -0
  93. package/dist/commonjs/funcs/users-posts-remove-like.d.ts.map +1 -0
  94. package/dist/commonjs/funcs/users-posts-remove-like.js +127 -0
  95. package/dist/commonjs/funcs/users-posts-remove-like.js.map +1 -0
  96. package/dist/commonjs/funcs/users-posts-update.d.ts +1 -1
  97. package/dist/commonjs/funcs/users-posts-update.d.ts.map +1 -1
  98. package/dist/commonjs/funcs/users-posts-update.js +3 -2
  99. package/dist/commonjs/funcs/users-posts-update.js.map +1 -1
  100. package/dist/commonjs/funcs/users-signup.d.ts +1 -1
  101. package/dist/commonjs/funcs/users-signup.d.ts.map +1 -1
  102. package/dist/commonjs/funcs/users-signup.js +3 -2
  103. package/dist/commonjs/funcs/users-signup.js.map +1 -1
  104. package/dist/commonjs/funcs/users-update.d.ts +1 -1
  105. package/dist/commonjs/funcs/users-update.d.ts.map +1 -1
  106. package/dist/commonjs/funcs/users-update.js +3 -2
  107. package/dist/commonjs/funcs/users-update.js.map +1 -1
  108. package/dist/commonjs/lib/config.d.ts +4 -4
  109. package/dist/commonjs/lib/config.js +4 -4
  110. package/dist/commonjs/lib/files.d.ts +13 -0
  111. package/dist/commonjs/lib/files.d.ts.map +1 -1
  112. package/dist/commonjs/lib/files.js +19 -0
  113. package/dist/commonjs/lib/files.js.map +1 -1
  114. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  115. package/dist/commonjs/lib/sdks.js +8 -4
  116. package/dist/commonjs/lib/sdks.js.map +1 -1
  117. package/dist/commonjs/lib/url.d.ts.map +1 -1
  118. package/dist/commonjs/lib/url.js +4 -2
  119. package/dist/commonjs/lib/url.js.map +1 -1
  120. package/dist/commonjs/models/operations/get-feed.d.ts +2 -0
  121. package/dist/commonjs/models/operations/get-feed.d.ts.map +1 -1
  122. package/dist/commonjs/models/operations/get-feed.js +2 -0
  123. package/dist/commonjs/models/operations/get-feed.js.map +1 -1
  124. package/dist/commonjs/models/operations/get-post-by-id.d.ts +2 -0
  125. package/dist/commonjs/models/operations/get-post-by-id.d.ts.map +1 -1
  126. package/dist/commonjs/models/operations/get-post-by-id.js +2 -0
  127. package/dist/commonjs/models/operations/get-post-by-id.js.map +1 -1
  128. package/dist/commonjs/models/operations/get-user-posts.d.ts +2 -0
  129. package/dist/commonjs/models/operations/get-user-posts.d.ts.map +1 -1
  130. package/dist/commonjs/models/operations/get-user-posts.js +2 -0
  131. package/dist/commonjs/models/operations/get-user-posts.js.map +1 -1
  132. package/dist/commonjs/models/operations/index.d.ts +2 -0
  133. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  134. package/dist/commonjs/models/operations/index.js +2 -0
  135. package/dist/commonjs/models/operations/index.js.map +1 -1
  136. package/dist/commonjs/models/operations/like-post.d.ts +12 -0
  137. package/dist/commonjs/models/operations/like-post.d.ts.map +1 -0
  138. package/dist/commonjs/models/operations/like-post.js +49 -0
  139. package/dist/commonjs/models/operations/like-post.js.map +1 -0
  140. package/dist/commonjs/models/operations/unlike-post.d.ts +12 -0
  141. package/dist/commonjs/models/operations/unlike-post.d.ts.map +1 -0
  142. package/dist/commonjs/models/operations/unlike-post.js +49 -0
  143. package/dist/commonjs/models/operations/unlike-post.js.map +1 -0
  144. package/dist/commonjs/sdk/activities.d.ts +5 -5
  145. package/dist/commonjs/sdk/activities.d.ts.map +1 -1
  146. package/dist/commonjs/sdk/categories.d.ts +3 -3
  147. package/dist/commonjs/sdk/categories.d.ts.map +1 -1
  148. package/dist/commonjs/sdk/friends.d.ts +2 -2
  149. package/dist/commonjs/sdk/friends.d.ts.map +1 -1
  150. package/dist/commonjs/sdk/posts.d.ts +12 -4
  151. package/dist/commonjs/sdk/posts.d.ts.map +1 -1
  152. package/dist/commonjs/sdk/posts.js +14 -0
  153. package/dist/commonjs/sdk/posts.js.map +1 -1
  154. package/dist/commonjs/sdk/schools.d.ts +1 -1
  155. package/dist/commonjs/sdk/schools.d.ts.map +1 -1
  156. package/dist/commonjs/sdk/users.d.ts +5 -5
  157. package/dist/commonjs/sdk/users.d.ts.map +1 -1
  158. package/dist/esm/funcs/categories-create.d.ts +1 -1
  159. package/dist/esm/funcs/categories-create.d.ts.map +1 -1
  160. package/dist/esm/funcs/categories-create.js +3 -2
  161. package/dist/esm/funcs/categories-create.js.map +1 -1
  162. package/dist/esm/funcs/categories-delete.js +2 -2
  163. package/dist/esm/funcs/categories-delete.js.map +1 -1
  164. package/dist/esm/funcs/categories-get-all.d.ts +1 -1
  165. package/dist/esm/funcs/categories-get-all.d.ts.map +1 -1
  166. package/dist/esm/funcs/categories-get-all.js +3 -2
  167. package/dist/esm/funcs/categories-get-all.js.map +1 -1
  168. package/dist/esm/funcs/categories-update.d.ts +1 -1
  169. package/dist/esm/funcs/categories-update.d.ts.map +1 -1
  170. package/dist/esm/funcs/categories-update.js +3 -2
  171. package/dist/esm/funcs/categories-update.js.map +1 -1
  172. package/dist/esm/funcs/schools-get-all.js +2 -2
  173. package/dist/esm/funcs/schools-get-all.js.map +1 -1
  174. package/dist/esm/funcs/schools-get.d.ts +1 -1
  175. package/dist/esm/funcs/schools-get.d.ts.map +1 -1
  176. package/dist/esm/funcs/schools-get.js +3 -2
  177. package/dist/esm/funcs/schools-get.js.map +1 -1
  178. package/dist/esm/funcs/users-activities-create.d.ts +1 -1
  179. package/dist/esm/funcs/users-activities-create.d.ts.map +1 -1
  180. package/dist/esm/funcs/users-activities-create.js +3 -2
  181. package/dist/esm/funcs/users-activities-create.js.map +1 -1
  182. package/dist/esm/funcs/users-activities-delete.js +2 -2
  183. package/dist/esm/funcs/users-activities-delete.js.map +1 -1
  184. package/dist/esm/funcs/users-activities-get-all-of-user.d.ts +1 -1
  185. package/dist/esm/funcs/users-activities-get-all-of-user.d.ts.map +1 -1
  186. package/dist/esm/funcs/users-activities-get-all-of-user.js +3 -2
  187. package/dist/esm/funcs/users-activities-get-all-of-user.js.map +1 -1
  188. package/dist/esm/funcs/users-activities-get.d.ts +1 -1
  189. package/dist/esm/funcs/users-activities-get.d.ts.map +1 -1
  190. package/dist/esm/funcs/users-activities-get.js +3 -2
  191. package/dist/esm/funcs/users-activities-get.js.map +1 -1
  192. package/dist/esm/funcs/users-activities-me.d.ts +1 -1
  193. package/dist/esm/funcs/users-activities-me.d.ts.map +1 -1
  194. package/dist/esm/funcs/users-activities-me.js +3 -2
  195. package/dist/esm/funcs/users-activities-me.js.map +1 -1
  196. package/dist/esm/funcs/users-activities-update.d.ts +1 -1
  197. package/dist/esm/funcs/users-activities-update.d.ts.map +1 -1
  198. package/dist/esm/funcs/users-activities-update.js +3 -2
  199. package/dist/esm/funcs/users-activities-update.js.map +1 -1
  200. package/dist/esm/funcs/users-delete.js +2 -2
  201. package/dist/esm/funcs/users-delete.js.map +1 -1
  202. package/dist/esm/funcs/users-friends-accept.js +2 -2
  203. package/dist/esm/funcs/users-friends-accept.js.map +1 -1
  204. package/dist/esm/funcs/users-friends-list.d.ts +1 -1
  205. package/dist/esm/funcs/users-friends-list.d.ts.map +1 -1
  206. package/dist/esm/funcs/users-friends-list.js +3 -2
  207. package/dist/esm/funcs/users-friends-list.js.map +1 -1
  208. package/dist/esm/funcs/users-friends-pending.d.ts +1 -1
  209. package/dist/esm/funcs/users-friends-pending.d.ts.map +1 -1
  210. package/dist/esm/funcs/users-friends-pending.js +3 -2
  211. package/dist/esm/funcs/users-friends-pending.js.map +1 -1
  212. package/dist/esm/funcs/users-friends-reject.js +2 -2
  213. package/dist/esm/funcs/users-friends-reject.js.map +1 -1
  214. package/dist/esm/funcs/users-friends-remove.js +2 -2
  215. package/dist/esm/funcs/users-friends-remove.js.map +1 -1
  216. package/dist/esm/funcs/users-friends-send-request.js +2 -2
  217. package/dist/esm/funcs/users-friends-send-request.js.map +1 -1
  218. package/dist/esm/funcs/users-get.d.ts +1 -1
  219. package/dist/esm/funcs/users-get.d.ts.map +1 -1
  220. package/dist/esm/funcs/users-get.js +3 -2
  221. package/dist/esm/funcs/users-get.js.map +1 -1
  222. package/dist/esm/funcs/users-login.d.ts +1 -1
  223. package/dist/esm/funcs/users-login.d.ts.map +1 -1
  224. package/dist/esm/funcs/users-login.js +3 -2
  225. package/dist/esm/funcs/users-login.js.map +1 -1
  226. package/dist/esm/funcs/users-me.d.ts +1 -1
  227. package/dist/esm/funcs/users-me.d.ts.map +1 -1
  228. package/dist/esm/funcs/users-me.js +3 -2
  229. package/dist/esm/funcs/users-me.js.map +1 -1
  230. package/dist/esm/funcs/users-posts-delete.js +2 -2
  231. package/dist/esm/funcs/users-posts-delete.js.map +1 -1
  232. package/dist/esm/funcs/users-posts-feed.d.ts +1 -1
  233. package/dist/esm/funcs/users-posts-feed.d.ts.map +1 -1
  234. package/dist/esm/funcs/users-posts-feed.js +3 -2
  235. package/dist/esm/funcs/users-posts-feed.js.map +1 -1
  236. package/dist/esm/funcs/users-posts-get-by-post-id.d.ts +1 -1
  237. package/dist/esm/funcs/users-posts-get-by-post-id.d.ts.map +1 -1
  238. package/dist/esm/funcs/users-posts-get-by-post-id.js +3 -2
  239. package/dist/esm/funcs/users-posts-get-by-post-id.js.map +1 -1
  240. package/dist/esm/funcs/users-posts-get-by-user-id.d.ts +1 -1
  241. package/dist/esm/funcs/users-posts-get-by-user-id.d.ts.map +1 -1
  242. package/dist/esm/funcs/users-posts-get-by-user-id.js +3 -2
  243. package/dist/esm/funcs/users-posts-get-by-user-id.js.map +1 -1
  244. package/dist/esm/funcs/users-posts-like.d.ts +14 -0
  245. package/dist/esm/funcs/users-posts-like.d.ts.map +1 -0
  246. package/dist/esm/funcs/users-posts-like.js +91 -0
  247. package/dist/esm/funcs/users-posts-like.js.map +1 -0
  248. package/dist/esm/funcs/users-posts-remove-like.d.ts +14 -0
  249. package/dist/esm/funcs/users-posts-remove-like.d.ts.map +1 -0
  250. package/dist/esm/funcs/users-posts-remove-like.js +91 -0
  251. package/dist/esm/funcs/users-posts-remove-like.js.map +1 -0
  252. package/dist/esm/funcs/users-posts-update.d.ts +1 -1
  253. package/dist/esm/funcs/users-posts-update.d.ts.map +1 -1
  254. package/dist/esm/funcs/users-posts-update.js +3 -2
  255. package/dist/esm/funcs/users-posts-update.js.map +1 -1
  256. package/dist/esm/funcs/users-signup.d.ts +1 -1
  257. package/dist/esm/funcs/users-signup.d.ts.map +1 -1
  258. package/dist/esm/funcs/users-signup.js +3 -2
  259. package/dist/esm/funcs/users-signup.js.map +1 -1
  260. package/dist/esm/funcs/users-update.d.ts +1 -1
  261. package/dist/esm/funcs/users-update.d.ts.map +1 -1
  262. package/dist/esm/funcs/users-update.js +3 -2
  263. package/dist/esm/funcs/users-update.js.map +1 -1
  264. package/dist/esm/lib/config.d.ts +4 -4
  265. package/dist/esm/lib/config.js +4 -4
  266. package/dist/esm/lib/files.d.ts +13 -0
  267. package/dist/esm/lib/files.d.ts.map +1 -1
  268. package/dist/esm/lib/files.js +18 -0
  269. package/dist/esm/lib/files.js.map +1 -1
  270. package/dist/esm/lib/sdks.d.ts.map +1 -1
  271. package/dist/esm/lib/sdks.js +8 -4
  272. package/dist/esm/lib/sdks.js.map +1 -1
  273. package/dist/esm/lib/url.d.ts.map +1 -1
  274. package/dist/esm/lib/url.js +4 -2
  275. package/dist/esm/lib/url.js.map +1 -1
  276. package/dist/esm/models/operations/get-feed.d.ts +2 -0
  277. package/dist/esm/models/operations/get-feed.d.ts.map +1 -1
  278. package/dist/esm/models/operations/get-feed.js +2 -0
  279. package/dist/esm/models/operations/get-feed.js.map +1 -1
  280. package/dist/esm/models/operations/get-post-by-id.d.ts +2 -0
  281. package/dist/esm/models/operations/get-post-by-id.d.ts.map +1 -1
  282. package/dist/esm/models/operations/get-post-by-id.js +2 -0
  283. package/dist/esm/models/operations/get-post-by-id.js.map +1 -1
  284. package/dist/esm/models/operations/get-user-posts.d.ts +2 -0
  285. package/dist/esm/models/operations/get-user-posts.d.ts.map +1 -1
  286. package/dist/esm/models/operations/get-user-posts.js +2 -0
  287. package/dist/esm/models/operations/get-user-posts.js.map +1 -1
  288. package/dist/esm/models/operations/index.d.ts +2 -0
  289. package/dist/esm/models/operations/index.d.ts.map +1 -1
  290. package/dist/esm/models/operations/index.js +2 -0
  291. package/dist/esm/models/operations/index.js.map +1 -1
  292. package/dist/esm/models/operations/like-post.d.ts +12 -0
  293. package/dist/esm/models/operations/like-post.d.ts.map +1 -0
  294. package/dist/esm/models/operations/like-post.js +12 -0
  295. package/dist/esm/models/operations/like-post.js.map +1 -0
  296. package/dist/esm/models/operations/unlike-post.d.ts +12 -0
  297. package/dist/esm/models/operations/unlike-post.d.ts.map +1 -0
  298. package/dist/esm/models/operations/unlike-post.js +12 -0
  299. package/dist/esm/models/operations/unlike-post.js.map +1 -0
  300. package/dist/esm/sdk/activities.d.ts +5 -5
  301. package/dist/esm/sdk/activities.d.ts.map +1 -1
  302. package/dist/esm/sdk/categories.d.ts +3 -3
  303. package/dist/esm/sdk/categories.d.ts.map +1 -1
  304. package/dist/esm/sdk/friends.d.ts +2 -2
  305. package/dist/esm/sdk/friends.d.ts.map +1 -1
  306. package/dist/esm/sdk/posts.d.ts +12 -4
  307. package/dist/esm/sdk/posts.d.ts.map +1 -1
  308. package/dist/esm/sdk/posts.js +14 -0
  309. package/dist/esm/sdk/posts.js.map +1 -1
  310. package/dist/esm/sdk/schools.d.ts +1 -1
  311. package/dist/esm/sdk/schools.d.ts.map +1 -1
  312. package/dist/esm/sdk/users.d.ts +5 -5
  313. package/dist/esm/sdk/users.d.ts.map +1 -1
  314. package/jsr.json +1 -1
  315. package/package.json +1 -1
  316. package/rest-api/cypress/e2e/activity-post-endpoints.cy.js +78 -0
  317. package/rest-api/cypress.config.ts +1 -0
  318. package/rest-api/index.js +2 -0
  319. package/rest-api/routes/ActivityPostFunctions.js +107 -10
  320. package/src/funcs/categories-create.ts +14 -6
  321. package/src/funcs/categories-delete.ts +3 -3
  322. package/src/funcs/categories-get-all.ts +14 -6
  323. package/src/funcs/categories-update.ts +14 -7
  324. package/src/funcs/schools-get-all.ts +2 -2
  325. package/src/funcs/schools-get.ts +11 -7
  326. package/src/funcs/users-activities-create.ts +14 -6
  327. package/src/funcs/users-activities-delete.ts +3 -3
  328. package/src/funcs/users-activities-get-all-of-user.ts +18 -7
  329. package/src/funcs/users-activities-get.ts +14 -7
  330. package/src/funcs/users-activities-me.ts +14 -6
  331. package/src/funcs/users-activities-update.ts +14 -7
  332. package/src/funcs/users-delete.ts +3 -3
  333. package/src/funcs/users-friends-accept.ts +3 -3
  334. package/src/funcs/users-friends-list.ts +14 -7
  335. package/src/funcs/users-friends-pending.ts +15 -6
  336. package/src/funcs/users-friends-reject.ts +3 -3
  337. package/src/funcs/users-friends-remove.ts +3 -3
  338. package/src/funcs/users-friends-send-request.ts +3 -3
  339. package/src/funcs/users-get.ts +11 -7
  340. package/src/funcs/users-login.ts +11 -6
  341. package/src/funcs/users-me.ts +14 -6
  342. package/src/funcs/users-posts-delete.ts +3 -3
  343. package/src/funcs/users-posts-feed.ts +14 -6
  344. package/src/funcs/users-posts-get-by-post-id.ts +11 -7
  345. package/src/funcs/users-posts-get-by-user-id.ts +14 -7
  346. package/src/funcs/users-posts-like.ts +174 -0
  347. package/src/funcs/users-posts-remove-like.ts +174 -0
  348. package/src/funcs/users-posts-update.ts +11 -7
  349. package/src/funcs/users-signup.ts +8 -6
  350. package/src/funcs/users-update.ts +11 -7
  351. package/src/lib/config.ts +4 -4
  352. package/src/lib/files.ts +22 -0
  353. package/src/lib/sdks.ts +7 -5
  354. package/src/lib/url.ts +16 -14
  355. package/src/models/operations/get-feed.ts +4 -0
  356. package/src/models/operations/get-post-by-id.ts +4 -0
  357. package/src/models/operations/get-user-posts.ts +4 -0
  358. package/src/models/operations/index.ts +2 -0
  359. package/src/models/operations/like-post.ts +28 -0
  360. package/src/models/operations/unlike-post.ts +30 -0
  361. package/src/sdk/activities.ts +5 -5
  362. package/src/sdk/categories.ts +3 -3
  363. package/src/sdk/friends.ts +2 -2
  364. package/src/sdk/posts.ts +34 -4
  365. package/src/sdk/schools.ts +1 -1
  366. 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
- post_date: "desc"
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: ["400", "401", "403", "4XX", "5XX"],
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(201, operations.CreateCategoryResponse$inboundSchema),
160
- M.fail([400, 401, 403, "4XX"]),
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: ["401", "403", "404", "4XX", "5XX"],
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.fail([401, 403, 404, "4XX"]),
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: ["401", "4XX", "5XX"],
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(200, z.array(operations.ListCategoriesResponse$inboundSchema)),
142
- M.fail([401, "4XX"]),
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: ["400", "401", "403", "404", "4XX", "5XX"],
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(200, operations.UpdateCategoryResponse$inboundSchema),
167
- M.fail([400, 401, 403, 404, "4XX"]),
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: ["4XX", "5XX"],
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("4XX"),
142
+ M.fail(429),
143
143
  M.fail("5XX"),
144
144
  )(response, req);
145
145
  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
  * 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: ["404", "4XX", "5XX"],
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(200, operations.GetSchoolByIdResponse$inboundSchema),
166
- M.fail([404, "4XX"]),
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: ["400", "401", "4XX", "5XX"],
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(201, operations.CreateActivityResponse$inboundSchema),
160
- M.fail([400, 401, "4XX"]),
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: ["401", "403", "404", "4XX", "5XX"],
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.fail([401, 403, 404, "4XX"]),
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) {