@@ -4,19 +4,19 @@ import {
44 baseProfilesSchema ,
55 arraybeSchema ,
66} from 'common/api/zod-types'
7- import { PrivateChatMessage } from 'common/chat-message'
8- import { CompatibilityScore } from 'common/love/compatibility-score'
9- import { MAX_COMPATIBILITY_QUESTION_LENGTH } from 'common/love/constants'
10- import { Profile , ProfileRow } from 'common/love/profile'
11- import { Row } from 'common/supabase/utils'
12- import { PrivateUser , User } from 'common/user'
13- import { z } from 'zod'
14- import { LikeData , ShipData } from './love-types'
15- import { DisplayUser , FullUser } from './user-types'
16- import { PrivateMessageChannel } from 'common/supabase/private-messages'
17- import { Notification } from 'common/notifications'
18- import { arrify } from 'common/util/array'
19- import { notification_preference } from 'common/user-notification-preferences'
7+ import { PrivateChatMessage } from 'common/chat-message'
8+ import { CompatibilityScore } from 'common/love/compatibility-score'
9+ import { MAX_COMPATIBILITY_QUESTION_LENGTH } from 'common/love/constants'
10+ import { Profile , ProfileRow } from 'common/love/profile'
11+ import { Row } from 'common/supabase/utils'
12+ import { PrivateUser , User } from 'common/user'
13+ import { z } from 'zod'
14+ import { LikeData , ShipData } from './love-types'
15+ import { DisplayUser , FullUser } from './user-types'
16+ import { PrivateMessageChannel } from 'common/supabase/private-messages'
17+ import { Notification } from 'common/notifications'
18+ import { arrify } from 'common/util/array'
19+ import { notification_preference } from 'common/user-notification-preferences'
2020
2121// mqp: very unscientific, just balancing our willingness to accept load
2222// with user willingness to put up with stale data
@@ -59,12 +59,12 @@ export const API = (_apiTypeCheck = {
5959 'user/by-id/:id/block' : {
6060 method : 'POST' ,
6161 authed : true ,
62- props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
62+ props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
6363 } ,
6464 'user/by-id/:id/unblock' : {
6565 method : 'POST' ,
6666 authed : true ,
67- props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
67+ props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
6868 } ,
6969 'ban-user' : {
7070 method : 'POST' ,
@@ -176,28 +176,28 @@ export const API = (_apiTypeCheck = {
176176 authed : false ,
177177 cache : DEFAULT_CACHE_STRATEGY ,
178178 returns : { } as FullUser ,
179- props : z . object ( { username : z . string ( ) } ) . strict ( ) ,
179+ props : z . object ( { username : z . string ( ) } ) . strict ( ) ,
180180 } ,
181181 'user/:username/lite' : {
182182 method : 'GET' ,
183183 authed : false ,
184184 cache : DEFAULT_CACHE_STRATEGY ,
185185 returns : { } as DisplayUser ,
186- props : z . object ( { username : z . string ( ) } ) . strict ( ) ,
186+ props : z . object ( { username : z . string ( ) } ) . strict ( ) ,
187187 } ,
188188 'user/by-id/:id' : {
189189 method : 'GET' ,
190190 authed : false ,
191191 cache : DEFAULT_CACHE_STRATEGY ,
192192 returns : { } as FullUser ,
193- props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
193+ props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
194194 } ,
195195 'user/by-id/:id/lite' : {
196196 method : 'GET' ,
197197 authed : false ,
198198 cache : DEFAULT_CACHE_STRATEGY ,
199199 returns : { } as DisplayUser ,
200- props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
200+ props : z . object ( { id : z . string ( ) } ) . strict ( ) ,
201201 } ,
202202 'search-users' : {
203203 method : 'GET' ,
@@ -215,7 +215,7 @@ export const API = (_apiTypeCheck = {
215215 'compatible-profiles' : {
216216 method : 'GET' ,
217217 authed : false ,
218- props : z . object ( { userId : z . string ( ) } ) ,
218+ props : z . object ( { userId : z . string ( ) } ) ,
219219 returns : { } as {
220220 profile : Profile
221221 compatibleProfiles : Profile [ ]
@@ -227,7 +227,7 @@ export const API = (_apiTypeCheck = {
227227 'remove-pinned-photo' : {
228228 method : 'POST' ,
229229 authed : true ,
230- returns : { success : true } ,
230+ returns : { success : true } ,
231231 props : z
232232 . object ( {
233233 userId : z . string ( ) ,
@@ -338,7 +338,7 @@ export const API = (_apiTypeCheck = {
338338 'get-profile-answers' : {
339339 method : 'GET' ,
340340 authed : false ,
341- props : z . object ( { userId : z . string ( ) } ) . strict ( ) ,
341+ props : z . object ( { userId : z . string ( ) } ) . strict ( ) ,
342342 returns : { } as {
343343 status : 'success'
344344 answers : Row < 'love_compatibility_answers' > [ ]
@@ -477,6 +477,12 @@ export const API = (_apiTypeCheck = {
477477 radius : z . number ( ) . min ( 1 ) . max ( 500 ) ,
478478 } ) ,
479479 } ,
480+ 'get-messages-count' : {
481+ method : 'GET' ,
482+ authed : false ,
483+ props : z . object ( { } ) ,
484+ returns : { } as { count : number } ,
485+ } ,
480486} as const )
481487
482488export type APIPath = keyof typeof API
@@ -488,8 +494,8 @@ export type ValidatedAPIParams<N extends APIPath> = z.output<
488494>
489495
490496export type APIResponse < N extends APIPath > = APISchema < N > extends {
491- returns : Record < string , any >
492- }
497+ returns : Record < string , any >
498+ }
493499 ? APISchema < N > [ 'returns' ]
494500 : void
495501
0 commit comments