feat: main 병합 + 인스타 올리기 API(/v1/card/{id}/instagram), 관리자 올릴 곳 선택(로컬·킹서버), 만든 카드 화면
This commit is contained in:
commit
572b2a05c8
188 files changed
+16605
-741
No files matched your search
@@ -3,8 +3,8 @@
|
||||
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
|
||||
|
||||
import { client } from '../client.gen';
|
||||
import { addComment, createCard, deleteComment, getArticle, getCardImage, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTodayGuPage, getTodayPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, publishCard, refresh, rejectCard, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, CreateCardData, CreateCardError, CreateCardResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, GetArticleData, GetArticleError, GetArticleResponse, GetCardImageData, GetCardImageError, GetFeedData, GetFeedError, GetFeedResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTodayGuPageData, GetTodayGuPageError, GetTodayGuPageResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, PublishCardData, PublishCardError, PublishCardResponse, RefreshData, RefreshError, RefreshResponse, RejectCardData, RejectCardError, RejectCardResponse, SavePostData, SavePostError, SavePostResponse, SignupData, SignupError, SignupResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse } from '../types.gen';
|
||||
import { addComment, addMyGak, addTalk, authConfig, blockTalkAuthor, createCard, deleteComment, deleteMyGak, deleteTalk, getArticle, getCardImage, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, likeComment, likePost, likeTalk, listArticles, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listRegions, listSaved, listTalks, login, logout, me, nearestRegion, type Options, publishCard, refresh, rejectCard, reportTalk, savePost, scoreMyGak, signup, talkGroups, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, AddMyGakData, AddMyGakError, AddMyGakResponse, AddTalkData, AddTalkError, AddTalkResponse, AuthConfigData, AuthConfigResponse, BlockTalkAuthorData, BlockTalkAuthorError, BlockTalkAuthorResponse, CreateCardData, CreateCardError, CreateCardResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, DeleteMyGakData, DeleteMyGakError, DeleteMyGakResponse, DeleteTalkData, DeleteTalkError, DeleteTalkResponse, GetArticleData, GetArticleError, GetArticleResponse, GetCardImageData, GetCardImageError, GetFeedData, GetFeedError, GetFeedResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTalkImageData, GetTalkImageError, GetTodayGuPageData, GetTodayGuPageError, GetTodayGuPageResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetTomorrowGuPageData, GetTomorrowGuPageError, GetTomorrowGuPageResponse, GetTomorrowPageData, GetTomorrowPageError, GetTomorrowPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, GoogleLoginData, GoogleLoginError, GoogleLoginResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, LikeTalkData, LikeTalkError, LikeTalkResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListCardsData, ListCardsError, ListCardsResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListMyGakData, ListMyGakError, ListMyGakResponse, ListMyTalksData, ListMyTalksError, ListMyTalksResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListPresetsData, ListPresetsResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, ListTalksData, ListTalksError, ListTalksResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, PublishCardData, PublishCardError, PublishCardResponse, RefreshData, RefreshError, RefreshResponse, RejectCardData, RejectCardError, RejectCardResponse, ReportTalkData, ReportTalkError, ReportTalkResponse, SavePostData, SavePostError, SavePostResponse, ScoreMyGakData, ScoreMyGakError, ScoreMyGakResponse, SignupData, SignupError, SignupResponse, TalkGroupsData, TalkGroupsError, TalkGroupsResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnlikeTalkData, UnlikeTalkError, UnlikeTalkResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse, UploadTalkImageData, UploadTalkImageError, UploadTalkImageResponse } from '../types.gen';
|
||||
|
||||
export type QueryKey<TOptions extends Options> = [
|
||||
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
||||
@@ -78,7 +78,7 @@ export const nearestRegionOptions = (options: Options<NearestRegionData>) => que
|
||||
export const getWeatherTodayQueryKey = (options: Options<GetWeatherTodayData>) => createQueryKey('getWeatherToday', options);
|
||||
|
||||
/**
|
||||
* 오늘 3시간 칸 날씨
|
||||
* 오늘(또는 내일) 3시간 칸 날씨
|
||||
*/
|
||||
export const getWeatherTodayOptions = (options: Options<GetWeatherTodayData>) => queryOptions<GetWeatherTodayResponse, GetWeatherTodayError, GetWeatherTodayResponse, ReturnType<typeof getWeatherTodayQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
@@ -379,6 +379,41 @@ export const loginMutation = (options?: Partial<Options<LoginData>>): UseMutatio
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 구글 로그인 (처음이면 자동 닉네임으로 가입)
|
||||
*/
|
||||
export const googleLoginMutation = (options?: Partial<Options<GoogleLoginData>>): UseMutationOptions<GoogleLoginResponse, GoogleLoginError, Options<GoogleLoginData>> => {
|
||||
const mutationOptions: UseMutationOptions<GoogleLoginResponse, GoogleLoginError, Options<GoogleLoginData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await googleLogin({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const authConfigQueryKey = (options?: Options<AuthConfigData>) => createQueryKey('authConfig', options);
|
||||
|
||||
/**
|
||||
* 로그인 화면 설정 (구글 클라이언트 ID)
|
||||
*/
|
||||
export const authConfigOptions = (options?: Options<AuthConfigData>) => queryOptions<AuthConfigResponse, DefaultError, AuthConfigResponse, ReturnType<typeof authConfigQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await authConfig({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: authConfigQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 토큰 재발급
|
||||
*/
|
||||
@@ -466,7 +501,7 @@ export const unlikePostMutation = (options?: Partial<Options<UnlikePostData>>):
|
||||
};
|
||||
|
||||
/**
|
||||
* 좋아요
|
||||
* 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likePostMutation = (options?: Partial<Options<LikePostData>>): UseMutationOptions<LikePostResponse, LikePostError, Options<LikePostData>> => {
|
||||
const mutationOptions: UseMutationOptions<LikePostResponse, LikePostError, Options<LikePostData>> = {
|
||||
@@ -642,7 +677,7 @@ export const listCommentsInfiniteOptions = (options: Options<ListCommentsData>)
|
||||
};
|
||||
|
||||
/**
|
||||
* 댓글 쓰기 (60자)
|
||||
* 댓글 쓰기 (60자, 로그인 없으면 '동네 익명'으로 IP 당 하루 20개)
|
||||
*/
|
||||
export const addCommentMutation = (options?: Partial<Options<AddCommentData>>): UseMutationOptions<AddCommentResponse, AddCommentError, Options<AddCommentData>> => {
|
||||
const mutationOptions: UseMutationOptions<AddCommentResponse, AddCommentError, Options<AddCommentData>> = {
|
||||
@@ -659,7 +694,7 @@ export const addCommentMutation = (options?: Partial<Options<AddCommentData>>):
|
||||
};
|
||||
|
||||
/**
|
||||
* 내 댓글 지우기
|
||||
* 내 댓글 지우기 (로그인 없이 쓴 댓글은 같은 IP 에서)
|
||||
*/
|
||||
export const deleteCommentMutation = (options?: Partial<Options<DeleteCommentData>>): UseMutationOptions<DeleteCommentResponse, DeleteCommentError, Options<DeleteCommentData>> => {
|
||||
const mutationOptions: UseMutationOptions<DeleteCommentResponse, DeleteCommentError, Options<DeleteCommentData>> = {
|
||||
@@ -693,7 +728,7 @@ export const unlikeCommentMutation = (options?: Partial<Options<UnlikeCommentDat
|
||||
};
|
||||
|
||||
/**
|
||||
* 댓글 좋아요
|
||||
* 댓글 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likeCommentMutation = (options?: Partial<Options<LikeCommentData>>): UseMutationOptions<LikeCommentResponse, LikeCommentError, Options<LikeCommentData>> => {
|
||||
const mutationOptions: UseMutationOptions<LikeCommentResponse, LikeCommentError, Options<LikeCommentData>> = {
|
||||
@@ -709,6 +744,344 @@ export const likeCommentMutation = (options?: Partial<Options<LikeCommentData>>)
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const listMyGakQueryKey = (options?: Options<ListMyGakData>) => createQueryKey('listMyGak', options);
|
||||
|
||||
/**
|
||||
* 내 각 목록 (로그인하지 않았으면 빈 목록)
|
||||
*/
|
||||
export const listMyGakOptions = (options?: Options<ListMyGakData>) => queryOptions<ListMyGakResponse, ListMyGakError, ListMyGakResponse, ReturnType<typeof listMyGakQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listMyGak({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listMyGakQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 이름과 날씨 조건으로 내 각 만들기
|
||||
*/
|
||||
export const addMyGakMutation = (options?: Partial<Options<AddMyGakData>>): UseMutationOptions<AddMyGakResponse, AddMyGakError, Options<AddMyGakData>> => {
|
||||
const mutationOptions: UseMutationOptions<AddMyGakResponse, AddMyGakError, Options<AddMyGakData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await addMyGak({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const listPresetsQueryKey = (options?: Options<ListPresetsData>) => createQueryKey('listPresets', options);
|
||||
|
||||
/**
|
||||
* 공식 각을 내 각 조건으로 옮긴 목록 (내 각 만들기에서 골라 채우기)
|
||||
*/
|
||||
export const listPresetsOptions = (options?: Options<ListPresetsData>) => queryOptions<ListPresetsResponse, DefaultError, ListPresetsResponse, ReturnType<typeof listPresetsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listPresets({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listPresetsQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 조건들의 그 동네 오늘 점수 (로그인 없이, 받은 링크의 각도)
|
||||
*/
|
||||
export const scoreMyGakMutation = (options?: Partial<Options<ScoreMyGakData>>): UseMutationOptions<ScoreMyGakResponse, ScoreMyGakError, Options<ScoreMyGakData>> => {
|
||||
const mutationOptions: UseMutationOptions<ScoreMyGakResponse, ScoreMyGakError, Options<ScoreMyGakData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await scoreMyGak({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 내 각 지우기
|
||||
*/
|
||||
export const deleteMyGakMutation = (options?: Partial<Options<DeleteMyGakData>>): UseMutationOptions<DeleteMyGakResponse, DeleteMyGakError, Options<DeleteMyGakData>> => {
|
||||
const mutationOptions: UseMutationOptions<DeleteMyGakResponse, DeleteMyGakError, Options<DeleteMyGakData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await deleteMyGak({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const talkGroupsQueryKey = (options?: Options<TalkGroupsData>) => createQueryKey('talkGroups', options);
|
||||
|
||||
/**
|
||||
* 오늘 피드 묶음 (동네 사람들 + 주제별, 가까운 동네·덜 지난 글 먼저, 한 사람 한 장)
|
||||
*/
|
||||
export const talkGroupsOptions = (options?: Options<TalkGroupsData>) => queryOptions<TalkGroupsResponse, TalkGroupsError, TalkGroupsResponse, ReturnType<typeof talkGroupsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await talkGroups({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: talkGroupsQueryKey(options)
|
||||
});
|
||||
|
||||
export const listTalksQueryKey = (options?: Options<ListTalksData>) => createQueryKey('listTalks', options);
|
||||
|
||||
/**
|
||||
* 동네 이야기 (전국 최신순, 보는 동네와 같은 시도 글은 앞으로, 같은 사람 글은 띄움, 로그인 없이 보기)
|
||||
*/
|
||||
export const listTalksOptions = (options?: Options<ListTalksData>) => queryOptions<ListTalksResponse, ListTalksError, ListTalksResponse, ReturnType<typeof listTalksQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listTalks({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listTalksQueryKey(options)
|
||||
});
|
||||
|
||||
export const listTalksInfiniteQueryKey = (options?: Options<ListTalksData>): QueryKey<Options<ListTalksData>> => createQueryKey('listTalks', options, true);
|
||||
|
||||
/**
|
||||
* 동네 이야기 (전국 최신순, 보는 동네와 같은 시도 글은 앞으로, 같은 사람 글은 띄움, 로그인 없이 보기)
|
||||
*/
|
||||
export const listTalksInfiniteOptions = (options?: Options<ListTalksData>) => {
|
||||
const opts = infiniteQueryOptions<ListTalksResponse, ListTalksError, InfiniteData<ListTalksResponse>, QueryKey<Options<ListTalksData>>, string | null | Pick<QueryKey<Options<ListTalksData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
||||
// @ts-ignore
|
||||
{
|
||||
queryFn: async ({ pageParam, queryKey, signal }) => {
|
||||
// @ts-ignore
|
||||
const page: Pick<QueryKey<Options<ListTalksData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
||||
query: {
|
||||
cursor: pageParam
|
||||
}
|
||||
};
|
||||
const params = createInfiniteParams(queryKey, page);
|
||||
const { data } = await listTalks({
|
||||
...options,
|
||||
...params,
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listTalksInfiniteQueryKey(options)
|
||||
});
|
||||
return opts as Omit<typeof opts, 'initialData'>;
|
||||
};
|
||||
|
||||
export const listMyTalksQueryKey = (options?: Options<ListMyTalksData>) => createQueryKey('listMyTalks', options);
|
||||
|
||||
/**
|
||||
* 내가 쓴 글 (최신순)
|
||||
*/
|
||||
export const listMyTalksOptions = (options?: Options<ListMyTalksData>) => queryOptions<ListMyTalksResponse, ListMyTalksError, ListMyTalksResponse, ReturnType<typeof listMyTalksQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listMyTalks({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listMyTalksQueryKey(options)
|
||||
});
|
||||
|
||||
export const listMyTalksInfiniteQueryKey = (options?: Options<ListMyTalksData>): QueryKey<Options<ListMyTalksData>> => createQueryKey('listMyTalks', options, true);
|
||||
|
||||
/**
|
||||
* 내가 쓴 글 (최신순)
|
||||
*/
|
||||
export const listMyTalksInfiniteOptions = (options?: Options<ListMyTalksData>) => {
|
||||
const opts = infiniteQueryOptions<ListMyTalksResponse, ListMyTalksError, InfiniteData<ListMyTalksResponse>, QueryKey<Options<ListMyTalksData>>, string | null | Pick<QueryKey<Options<ListMyTalksData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
||||
// @ts-ignore
|
||||
{
|
||||
queryFn: async ({ pageParam, queryKey, signal }) => {
|
||||
// @ts-ignore
|
||||
const page: Pick<QueryKey<Options<ListMyTalksData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
||||
query: {
|
||||
cursor: pageParam
|
||||
}
|
||||
};
|
||||
const params = createInfiniteParams(queryKey, page);
|
||||
const { data } = await listMyTalks({
|
||||
...options,
|
||||
...params,
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listMyTalksInfiniteQueryKey(options)
|
||||
});
|
||||
return opts as Omit<typeof opts, 'initialData'>;
|
||||
};
|
||||
|
||||
/**
|
||||
* 동네 이야기 쓰기 (링크·전화번호 불가, 하루 5개)
|
||||
*/
|
||||
export const addTalkMutation = (options?: Partial<Options<AddTalkData>>): UseMutationOptions<AddTalkResponse, AddTalkError, Options<AddTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<AddTalkResponse, AddTalkError, Options<AddTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await addTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 글에 붙일 사진 올리기 (10MB까지, 위치 정보를 지우고 1080px로 줄여 저장)
|
||||
*/
|
||||
export const uploadTalkImageMutation = (options?: Partial<Options<UploadTalkImageData>>): UseMutationOptions<UploadTalkImageResponse, UploadTalkImageError, Options<UploadTalkImageData>> => {
|
||||
const mutationOptions: UseMutationOptions<UploadTalkImageResponse, UploadTalkImageError, Options<UploadTalkImageData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await uploadTalkImage({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getTalkImageQueryKey = (options: Options<GetTalkImageData>) => createQueryKey('getTalkImage', options);
|
||||
|
||||
/**
|
||||
* 올린 사진
|
||||
*/
|
||||
export const getTalkImageOptions = (options: Options<GetTalkImageData>) => queryOptions<unknown, GetTalkImageError, unknown, ReturnType<typeof getTalkImageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTalkImage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTalkImageQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 내 이야기 지우기
|
||||
*/
|
||||
export const deleteTalkMutation = (options?: Partial<Options<DeleteTalkData>>): UseMutationOptions<DeleteTalkResponse, DeleteTalkError, Options<DeleteTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<DeleteTalkResponse, DeleteTalkError, Options<DeleteTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await deleteTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이야기 좋아요 취소
|
||||
*/
|
||||
export const unlikeTalkMutation = (options?: Partial<Options<UnlikeTalkData>>): UseMutationOptions<UnlikeTalkResponse, UnlikeTalkError, Options<UnlikeTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<UnlikeTalkResponse, UnlikeTalkError, Options<UnlikeTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await unlikeTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이야기 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likeTalkMutation = (options?: Partial<Options<LikeTalkData>>): UseMutationOptions<LikeTalkResponse, LikeTalkError, Options<LikeTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<LikeTalkResponse, LikeTalkError, Options<LikeTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await likeTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이야기 신고 (서로 다른 3명이면 숨김)
|
||||
*/
|
||||
export const reportTalkMutation = (options?: Partial<Options<ReportTalkData>>): UseMutationOptions<ReportTalkResponse, ReportTalkError, Options<ReportTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<ReportTalkResponse, ReportTalkError, Options<ReportTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await reportTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이 글 쓴 사람의 글 안 보기
|
||||
*/
|
||||
export const blockTalkAuthorMutation = (options?: Partial<Options<BlockTalkAuthorData>>): UseMutationOptions<BlockTalkAuthorResponse, BlockTalkAuthorError, Options<BlockTalkAuthorData>> => {
|
||||
const mutationOptions: UseMutationOptions<BlockTalkAuthorResponse, BlockTalkAuthorError, Options<BlockTalkAuthorData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await blockTalkAuthor({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getWatchSummaryQueryKey = (options: Options<GetWatchSummaryData>) => createQueryKey('getWatchSummary', options);
|
||||
|
||||
/**
|
||||
@@ -781,6 +1154,60 @@ export const getTodayGuPageOptions = (options: Options<GetTodayGuPageData>) => q
|
||||
queryKey: getTodayGuPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const getTomorrowPageQueryKey = (options: Options<GetTomorrowPageData>) => createQueryKey('getTomorrowPage', options);
|
||||
|
||||
/**
|
||||
* 지역 내일 날씨 페이지: 정적 HTML 에 내일 예보를 채운다 (nginx 가 /tomorrow/... 를 넘김)
|
||||
*/
|
||||
export const getTomorrowPageOptions = (options: Options<GetTomorrowPageData>) => queryOptions<GetTomorrowPageResponse, GetTomorrowPageError, GetTomorrowPageResponse, ReturnType<typeof getTomorrowPageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTomorrowPage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTomorrowPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const getTomorrowGuPageQueryKey = (options: Options<GetTomorrowGuPageData>) => createQueryKey('getTomorrowGuPage', options);
|
||||
|
||||
/**
|
||||
* 구로 나뉜 시의 구 내일 날씨 페이지
|
||||
*/
|
||||
export const getTomorrowGuPageOptions = (options: Options<GetTomorrowGuPageData>) => queryOptions<GetTomorrowGuPageResponse, GetTomorrowGuPageError, GetTomorrowGuPageResponse, ReturnType<typeof getTomorrowGuPageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTomorrowGuPage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTomorrowGuPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const listCardsQueryKey = (options?: Options<ListCardsData>) => createQueryKey('listCards', options);
|
||||
|
||||
/**
|
||||
* 만든 카드뉴스 목록 (관리자). 다시 내려받거나 올릴 때
|
||||
*/
|
||||
export const listCardsOptions = (options?: Options<ListCardsData>) => queryOptions<ListCardsResponse, ListCardsError, ListCardsResponse, ReturnType<typeof listCardsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listCards({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listCardsQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 카드뉴스 저장 (관리자). publish 면 바로 그날 피드에 올린다
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { addComment, createCard, deleteComment, getArticle, getCardImage, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTodayGuPage, getTodayPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, publishCard, refresh, rejectCard, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, CardStatus, type ClientOptions, type CommentData, type CommuteData, Confidence, type CreateCardData, type CreateCardError, type CreateCardErrors, type CreateCardResponse, type CreateCardResponses, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetCardImageData, type GetCardImageError, type GetCardImageErrors, type GetCardImageResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetTodayGuPageData, type GetTodayGuPageError, type GetTodayGuPageErrors, type GetTodayGuPageResponse, type GetTodayGuPageResponses, type GetTodayPageData, type GetTodayPageError, type GetTodayPageErrors, type GetTodayPageResponse, type GetTodayPageResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HourCell, type HoursSlide, type HttpValidationError, type ImageSlide, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListPlacesData, type ListPlacesError, type ListPlacesErrors, type ListPlacesResponse, type ListPlacesResponses, type ListRegionsData, type ListRegionsError, type ListRegionsErrors, type ListRegionsResponse, type ListRegionsResponses, type ListSavedData, type ListSavedError, type ListSavedErrors, type ListSavedResponse, type ListSavedResponses, type LoginData, type LoginError, type LoginErrors, type LoginResponse, type LoginResponses, type LogoutData, type LogoutError, type LogoutErrors, type LogoutResponse, type LogoutResponses, type Me, type MeData, type MeError, type MeErrors, type MeResponse, type MeResponses, type NearestRegionData, type NearestRegionError, type NearestRegionErrors, type NearestRegionResponse, type NearestRegionResponses, type PlaceData, type PlanSlide, type PlanSpot, type PlanStep, type PostData, PostType, type PublishCardData, type PublishCardError, type PublishCardErrors, type PublishCardResponse, type PublishCardResponses, type Rain2h, type RainHourData, RainType, type RankData, type RefreshData, type RefreshError, type RefreshErrors, type RefreshResponse, type RefreshResponses, type RegionData, type RejectCardData, type RejectCardError, type RejectCardErrors, type RejectCardResponse, type RejectCardResponses, type ReqCardCreate, type ReqComment, type ReqLogin, type ReqRefresh, type ReqSignup, type ReqUpdateMe, type ResArticle, type ResArticleList, type ResAuth, type ResCard, type ResComment, type ResCommentLike, type ResCommentList, type ResEventList, type ResFeed, type ResHealth, type ResIndexDetail, type ResIndexList, type ResLogout, type ResMe, type ResPlaceList, type ResPostLine truncated
|
||||
export { addComment, addMyGak, addTalk, authConfig, blockTalkAuthor, createCard, deleteComment, deleteMyGak, deleteTalk, getArticle, getCardImage, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, likeComment, likePost, likeTalk, listArticles, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listRegions, listSaved, listTalks, login, logout, me, nearestRegion, type Options, publishCard, refresh, rejectCard, reportTalk, savePost, scoreMyGak, signup, talkGroups, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AddMyGakData, type AddMyGakError, type AddMyGakErrors, type AddMyGakResponse, type AddMyGakResponses, type AddTalkData, type AddTalkError, type AddTalkErrors, type AddTalkResponse, type AddTalkResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, type AuthConfigData, type AuthConfigResponse, type AuthConfigResponses, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type BlockTalkAuthorData, type BlockTalkAuthorError, type BlockTalkAuthorErrors, type BlockTalkAuthorResponse, type BlockTalkAuthorResponses, type BodyUploadTalkImageV1TalkImagePost, type CardItem, CardStatus, type ClientOptions, type CommentData, type CommuteData, Confidence, type CreateCardData, type CreateCardError, type CreateCardErrors, type CreateCardResponse, type CreateCardResponses, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type DeleteMyGakData, type DeleteMyGakError, type DeleteMyGakErrors, type DeleteMyGakResponse, type DeleteMyGakResponses, type DeleteTalkData, type DeleteTalkError, type DeleteTalkErrors, type DeleteTalkResponse, type DeleteTalkResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetCardImageData, type GetCardImageError, type GetCardImageErrors, type GetCardImageResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetTalkImageData, type GetTalkImageError, type GetTalkImageErrors, type GetTalkImageResponses, type GetTodayGuPageData, type GetTodayGuPageError, type GetTodayGuPageErrors, type GetTodayGuPageResponse, type GetTodayGuPageResponses, type GetTodayPageData, type GetTodayPageError, type GetTodayPageErrors, type GetTodayPageResponse, type GetTodayPageResponses, type GetTomorrowGuPageData, type GetTomorrowGuPageError, type GetTomorrowGuPageErrors, type GetTomorrowGuPageResponse, type GetTomorrowGuPageResponses, type GetTomorrowPageData, type GetTomorrowPageError, type GetTomorrowPageErrors, type GetTomorrowPageResponse, type GetTomorrowPageResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type GoogleLoginData, type GoogleLoginError, type GoogleLoginErrors, type GoogleLoginResponse, type GoogleLoginResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HeroTomorrow, type HourCell, type HoursSlide, type HttpValidationError, type ImageSlide, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type LikeTalkData, type LikeTalkError, type LikeTalkErrors, type LikeTalkResponse, type LikeTalkResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCardsData, type ListCardsError, type ListCardsErrors, type ListCardsResponse, type ListCardsResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListMyGakData, type ListMyGakError, type ListMyGakErrors, type ListMyGakResponse, type ListMyGakResponses, type ListMyTalksData, type ListMyTalksError, type LiLine truncated
|
||||
@@ -1,8 +1,8 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
|
||||
import { type Client, type ClientMeta, formDataBodySerializer, type Options as Options2, type RequestResult, type TDataShape } from './client';
|
||||
import { client } from './client.gen';
|
||||
import type { AddCommentData, AddCommentErrors, AddCommentResponses, CreateCardData, CreateCardErrors, CreateCardResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetCardImageData, GetCardImageErrors, GetCardImageResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetImageData, GetImageErrors, GetImageResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetTodayGuPageData, GetTodayGuPageErrors, GetTodayGuPageResponses, GetTodayPageData, GetTodayPageErrors, GetTodayPageResponses, GetWatchSummaryData, GetWatchSummaryErrors, GetWatchSummaryResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekRankingData, GetWeekRankingResponses, GetWeekResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutErrors, LogoutResponses, MeData, MeErrors, MeResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, PublishCardData, PublishCardErrors, PublishCardResponses, RefreshData, RefreshErrors, RefreshResponses, RejectCardData, RejectCardErrors, RejectCardResponses, SavePostData, SavePostErrors, SavePostResponses, SignupData, SignupErrors, SignupResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses, UpdateMeData, UpdateMeErrors, UpdateMeResponses } from './types.gen';
|
||||
import type { AddCommentData, AddCommentErrors, AddCommentResponses, AddMyGakData, AddMyGakErrors, AddMyGakResponses, AddTalkData, AddTalkErrors, AddTalkResponses, AuthConfigData, AuthConfigResponses, BlockTalkAuthorData, BlockTalkAuthorErrors, BlockTalkAuthorResponses, CreateCardData, CreateCardErrors, CreateCardResponses, DeleteCommentData, DeleteCommentErrors, DeleteCommentResponses, DeleteMyGakData, DeleteMyGakErrors, DeleteMyGakResponses, DeleteTalkData, DeleteTalkErrors, DeleteTalkResponses, GetArticleData, GetArticleErrors, GetArticleResponses, GetCardImageData, GetCardImageErrors, GetCardImageResponses, GetFeedData, GetFeedErrors, GetFeedResponses, GetImageData, GetImageErrors, GetImageResponses, GetIndexData, GetIndexErrors, GetIndexResponses, GetPostData, GetPostErrors, GetPostResponses, GetSeasonWeekData, GetSeasonWeekResponses, GetSkyData, GetSkyErrors, GetSkyRankingData, GetSkyRankingResponses, GetSkyResponses, GetTalkImageData, GetTalkImageErrors, GetTalkImageResponses, GetTodayGuPageData, GetTodayGuPageErrors, GetTodayGuPageResponses, GetTodayPageData, GetTodayPageErrors, GetTodayPageResponses, GetTomorrowGuPageData, GetTomorrowGuPageErrors, GetTomorrowGuPageResponses, GetTomorrowPageData, GetTomorrowPageErrors, GetTomorrowPageResponses, GetWatchSummaryData, GetWatchSummaryErrors, GetWatchSummaryResponses, GetWeatherNowData, GetWeatherNowErrors, GetWeatherNowResponses, GetWeatherTodayData, GetWeatherTodayErrors, GetWeatherTodayResponses, GetWeekData, GetWeekErrors, GetWeekRankingData, GetWeekRankingResponses, GetWeekResponses, GoogleLoginData, GoogleLoginErrors, GoogleLoginResponses, HealthzHealthzGetData, HealthzHealthzGetResponses, LikeCommentData, LikeCommentErrors, LikeCommentResponses, LikePostData, LikePostErrors, LikePostResponses, LikeTalkData, LikeTalkErrors, LikeTalkResponses, ListArticlesData, ListArticlesErrors, ListArticlesResponses, ListCardsData, ListCardsErrors, ListCardsResponses, ListCommentsData, ListCommentsErrors, ListCommentsResponses, ListEventsData, ListEventsErrors, ListEventsResponses, ListIndicesData, ListIndicesErrors, ListIndicesResponses, ListMyGakData, ListMyGakErrors, ListMyGakResponses, ListMyTalksData, ListMyTalksErrors, ListMyTalksResponses, ListPlacesData, ListPlacesErrors, ListPlacesResponses, ListPresetsData, ListPresetsResponses, ListRegionsData, ListRegionsErrors, ListRegionsResponses, ListSavedData, ListSavedErrors, ListSavedResponses, ListTalksData, ListTalksErrors, ListTalksResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutErrors, LogoutResponses, MeData, MeErrors, MeResponses, NearestRegionData, NearestRegionErrors, NearestRegionResponses, PublishCardData, PublishCardErrors, PublishCardResponses, RefreshData, RefreshErrors, RefreshResponses, RejectCardData, RejectCardErrors, RejectCardResponses, ReportTalkData, ReportTalkErrors, ReportTalkResponses, SavePostData, SavePostErrors, SavePostResponses, ScoreMyGakData, ScoreMyGakErrors, ScoreMyGakResponses, SignupData, SignupErrors, SignupResponses, TalkGroupsData, TalkGroupsErrors, TalkGroupsResponses, UnlikeCommentData, UnlikeCommentErrors, UnlikeCommentResponses, UnlikePostData, UnlikePostErrors, UnlikePostResponses, UnlikeTalkData, UnlikeTalkErrors, UnlikeTalkResponses, UnsavePostData, UnsavePostErrors, UnsavePostResponses, UpdateMeData, UpdateMeErrors, UpdateMeResponses, UploadTalkImageData, UploadTalkImageErrors, UploadTalkImageResponses } from './types.gen';
|
||||
|
||||
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ export const listRegions = <ThrowOnError extends boolean = true>(options?: Optio
|
||||
export const nearestRegion = <ThrowOnError extends boolean = true>(options: Options<NearestRegionData, ThrowOnError>): RequestResult<NearestRegionResponses, NearestRegionErrors, ThrowOnError> => (options.client ?? client).get<NearestRegionResponses, NearestRegionErrors, ThrowOnError>({ url: '/v1/region/nearest', ...options });
|
||||
|
||||
/**
|
||||
* 오늘 3시간 칸 날씨
|
||||
* 오늘(또는 내일) 3시간 칸 날씨
|
||||
*/
|
||||
export const getWeatherToday = <ThrowOnError extends boolean = true>(options: Options<GetWeatherTodayData, ThrowOnError>): RequestResult<GetWeatherTodayResponses, GetWeatherTodayErrors, ThrowOnError> => (options.client ?? client).get<GetWeatherTodayResponses, GetWeatherTodayErrors, ThrowOnError>({ url: '/v1/weather/today', ...options });
|
||||
|
||||
@@ -127,6 +127,23 @@ export const login = <ThrowOnError extends boolean = true>(options: Options<Logi
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 구글 로그인 (처음이면 자동 닉네임으로 가입)
|
||||
*/
|
||||
export const googleLogin = <ThrowOnError extends boolean = true>(options: Options<GoogleLoginData, ThrowOnError>): RequestResult<GoogleLoginResponses, GoogleLoginErrors, ThrowOnError> => (options.client ?? client).post<GoogleLoginResponses, GoogleLoginErrors, ThrowOnError>({
|
||||
url: '/v1/auth/google',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 로그인 화면 설정 (구글 클라이언트 ID)
|
||||
*/
|
||||
export const authConfig = <ThrowOnError extends boolean = true>(options?: Options<AuthConfigData, ThrowOnError>): RequestResult<AuthConfigResponses, unknown, ThrowOnError> => (options?.client ?? client).get<AuthConfigResponses, unknown, ThrowOnError>({ url: '/v1/auth/config', ...options });
|
||||
|
||||
/**
|
||||
* 토큰 재발급
|
||||
*/
|
||||
@@ -167,7 +184,7 @@ export const updateMe = <ThrowOnError extends boolean = true>(options: Options<U
|
||||
export const unlikePost = <ThrowOnError extends boolean = true>(options: Options<UnlikePostData, ThrowOnError>): RequestResult<UnlikePostResponses, UnlikePostErrors, ThrowOnError> => (options.client ?? client).delete<UnlikePostResponses, UnlikePostErrors, ThrowOnError>({ url: '/v1/reaction/post/{post_id}/like', ...options });
|
||||
|
||||
/**
|
||||
* 좋아요
|
||||
* 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likePost = <ThrowOnError extends boolean = true>(options: Options<LikePostData, ThrowOnError>): RequestResult<LikePostResponses, LikePostErrors, ThrowOnError> => (options.client ?? client).post<LikePostResponses, LikePostErrors, ThrowOnError>({ url: '/v1/reaction/post/{post_id}/like', ...options });
|
||||
|
||||
@@ -192,7 +209,7 @@ export const listSaved = <ThrowOnError extends boolean = true>(options?: Options
|
||||
export const listComments = <ThrowOnError extends boolean = true>(options: Options<ListCommentsData, ThrowOnError>): RequestResult<ListCommentsResponses, ListCommentsErrors, ThrowOnError> => (options.client ?? client).get<ListCommentsResponses, ListCommentsErrors, ThrowOnError>({ url: '/v1/reaction/post/{post_id}/comment/list', ...options });
|
||||
|
||||
/**
|
||||
* 댓글 쓰기 (60자)
|
||||
* 댓글 쓰기 (60자, 로그인 없으면 '동네 익명'으로 IP 당 하루 20개)
|
||||
*/
|
||||
export const addComment = <ThrowOnError extends boolean = true>(options: Options<AddCommentData, ThrowOnError>): RequestResult<AddCommentResponses, AddCommentErrors, ThrowOnError> => (options.client ?? client).post<AddCommentResponses, AddCommentErrors, ThrowOnError>({
|
||||
url: '/v1/reaction/post/{post_id}/comment',
|
||||
@@ -204,7 +221,7 @@ export const addComment = <ThrowOnError extends boolean = true>(options: Options
|
||||
});
|
||||
|
||||
/**
|
||||
* 내 댓글 지우기
|
||||
* 내 댓글 지우기 (로그인 없이 쓴 댓글은 같은 IP 에서)
|
||||
*/
|
||||
export const deleteComment = <ThrowOnError extends boolean = true>(options: Options<DeleteCommentData, ThrowOnError>): RequestResult<DeleteCommentResponses, DeleteCommentErrors, ThrowOnError> => (options.client ?? client).delete<DeleteCommentResponses, DeleteCommentErrors, ThrowOnError>({ url: '/v1/reaction/comment/{comment_id}', ...options });
|
||||
|
||||
@@ -214,10 +231,126 @@ export const deleteComment = <ThrowOnError extends boolean = true>(options: Opti
|
||||
export const unlikeComment = <ThrowOnError extends boolean = true>(options: Options<UnlikeCommentData, ThrowOnError>): RequestResult<UnlikeCommentResponses, UnlikeCommentErrors, ThrowOnError> => (options.client ?? client).delete<UnlikeCommentResponses, UnlikeCommentErrors, ThrowOnError>({ url: '/v1/reaction/comment/{comment_id}/like', ...options });
|
||||
|
||||
/**
|
||||
* 댓글 좋아요
|
||||
* 댓글 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likeComment = <ThrowOnError extends boolean = true>(options: Options<LikeCommentData, ThrowOnError>): RequestResult<LikeCommentResponses, LikeCommentErrors, ThrowOnError> => (options.client ?? client).post<LikeCommentResponses, LikeCommentErrors, ThrowOnError>({ url: '/v1/reaction/comment/{comment_id}/like', ...options });
|
||||
|
||||
/**
|
||||
* 내 각 목록 (로그인하지 않았으면 빈 목록)
|
||||
*/
|
||||
export const listMyGak = <ThrowOnError extends boolean = true>(options?: Options<ListMyGakData, ThrowOnError>): RequestResult<ListMyGakResponses, ListMyGakErrors, ThrowOnError> => (options?.client ?? client).get<ListMyGakResponses, ListMyGakErrors, ThrowOnError>({ url: '/v1/my-gak', ...options });
|
||||
|
||||
/**
|
||||
* 이름과 날씨 조건으로 내 각 만들기
|
||||
*/
|
||||
export const addMyGak = <ThrowOnError extends boolean = true>(options: Options<AddMyGakData, ThrowOnError>): RequestResult<AddMyGakResponses, AddMyGakErrors, ThrowOnError> => (options.client ?? client).post<AddMyGakResponses, AddMyGakErrors, ThrowOnError>({
|
||||
url: '/v1/my-gak',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 공식 각을 내 각 조건으로 옮긴 목록 (내 각 만들기에서 골라 채우기)
|
||||
*/
|
||||
export const listPresets = <ThrowOnError extends boolean = true>(options?: Options<ListPresetsData, ThrowOnError>): RequestResult<ListPresetsResponses, unknown, ThrowOnError> => (options?.client ?? client).get<ListPresetsResponses, unknown, ThrowOnError>({ url: '/v1/my-gak/presets', ...options });
|
||||
|
||||
/**
|
||||
* 조건들의 그 동네 오늘 점수 (로그인 없이, 받은 링크의 각도)
|
||||
*/
|
||||
export const scoreMyGak = <ThrowOnError extends boolean = true>(options: Options<ScoreMyGakData, ThrowOnError>): RequestResult<ScoreMyGakResponses, ScoreMyGakErrors, ThrowOnError> => (options.client ?? client).post<ScoreMyGakResponses, ScoreMyGakErrors, ThrowOnError>({
|
||||
url: '/v1/my-gak/score',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 내 각 지우기
|
||||
*/
|
||||
export const deleteMyGak = <ThrowOnError extends boolean = true>(options: Options<DeleteMyGakData, ThrowOnError>): RequestResult<DeleteMyGakResponses, DeleteMyGakErrors, ThrowOnError> => (options.client ?? client).delete<DeleteMyGakResponses, DeleteMyGakErrors, ThrowOnError>({ url: '/v1/my-gak/{my_gak_id}', ...options });
|
||||
|
||||
/**
|
||||
* 오늘 피드 묶음 (동네 사람들 + 주제별, 가까운 동네·덜 지난 글 먼저, 한 사람 한 장)
|
||||
*/
|
||||
export const talkGroups = <ThrowOnError extends boolean = true>(options?: Options<TalkGroupsData, ThrowOnError>): RequestResult<TalkGroupsResponses, TalkGroupsErrors, ThrowOnError> => (options?.client ?? client).get<TalkGroupsResponses, TalkGroupsErrors, ThrowOnError>({ url: '/v1/talk/groups', ...options });
|
||||
|
||||
/**
|
||||
* 동네 이야기 (전국 최신순, 보는 동네와 같은 시도 글은 앞으로, 같은 사람 글은 띄움, 로그인 없이 보기)
|
||||
*/
|
||||
export const listTalks = <ThrowOnError extends boolean = true>(options?: Options<ListTalksData, ThrowOnError>): RequestResult<ListTalksResponses, ListTalksErrors, ThrowOnError> => (options?.client ?? client).get<ListTalksResponses, ListTalksErrors, ThrowOnError>({ url: '/v1/talk/list', ...options });
|
||||
|
||||
/**
|
||||
* 내가 쓴 글 (최신순)
|
||||
*/
|
||||
export const listMyTalks = <ThrowOnError extends boolean = true>(options?: Options<ListMyTalksData, ThrowOnError>): RequestResult<ListMyTalksResponses, ListMyTalksErrors, ThrowOnError> => (options?.client ?? client).get<ListMyTalksResponses, ListMyTalksErrors, ThrowOnError>({ url: '/v1/talk/mine', ...options });
|
||||
|
||||
/**
|
||||
* 동네 이야기 쓰기 (링크·전화번호 불가, 하루 5개)
|
||||
*/
|
||||
export const addTalk = <ThrowOnError extends boolean = true>(options: Options<AddTalkData, ThrowOnError>): RequestResult<AddTalkResponses, AddTalkErrors, ThrowOnError> => (options.client ?? client).post<AddTalkResponses, AddTalkErrors, ThrowOnError>({
|
||||
url: '/v1/talk',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 글에 붙일 사진 올리기 (10MB까지, 위치 정보를 지우고 1080px로 줄여 저장)
|
||||
*/
|
||||
export const uploadTalkImage = <ThrowOnError extends boolean = true>(options: Options<UploadTalkImageData, ThrowOnError>): RequestResult<UploadTalkImageResponses, UploadTalkImageErrors, ThrowOnError> => (options.client ?? client).post<UploadTalkImageResponses, UploadTalkImageErrors, ThrowOnError>({
|
||||
...formDataBodySerializer,
|
||||
url: '/v1/talk/image',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': null,
|
||||
...options.headers
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 올린 사진
|
||||
*/
|
||||
export const getTalkImage = <ThrowOnError extends boolean = true>(options: Options<GetTalkImageData, ThrowOnError>): RequestResult<GetTalkImageResponses, GetTalkImageErrors, ThrowOnError> => (options.client ?? client).get<GetTalkImageResponses, GetTalkImageErrors, ThrowOnError>({ url: '/v1/talk/image/{name}', ...options });
|
||||
|
||||
/**
|
||||
* 내 이야기 지우기
|
||||
*/
|
||||
export const deleteTalk = <ThrowOnError extends boolean = true>(options: Options<DeleteTalkData, ThrowOnError>): RequestResult<DeleteTalkResponses, DeleteTalkErrors, ThrowOnError> => (options.client ?? client).delete<DeleteTalkResponses, DeleteTalkErrors, ThrowOnError>({ url: '/v1/talk/{talk_id}', ...options });
|
||||
|
||||
/**
|
||||
* 이야기 좋아요 취소
|
||||
*/
|
||||
export const unlikeTalk = <ThrowOnError extends boolean = true>(options: Options<UnlikeTalkData, ThrowOnError>): RequestResult<UnlikeTalkResponses, UnlikeTalkErrors, ThrowOnError> => (options.client ?? client).delete<UnlikeTalkResponses, UnlikeTalkErrors, ThrowOnError>({ url: '/v1/talk/{talk_id}/like', ...options });
|
||||
|
||||
/**
|
||||
* 이야기 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likeTalk = <ThrowOnError extends boolean = true>(options: Options<LikeTalkData, ThrowOnError>): RequestResult<LikeTalkResponses, LikeTalkErrors, ThrowOnError> => (options.client ?? client).post<LikeTalkResponses, LikeTalkErrors, ThrowOnError>({ url: '/v1/talk/{talk_id}/like', ...options });
|
||||
|
||||
/**
|
||||
* 이야기 신고 (서로 다른 3명이면 숨김)
|
||||
*/
|
||||
export const reportTalk = <ThrowOnError extends boolean = true>(options: Options<ReportTalkData, ThrowOnError>): RequestResult<ReportTalkResponses, ReportTalkErrors, ThrowOnError> => (options.client ?? client).post<ReportTalkResponses, ReportTalkErrors, ThrowOnError>({
|
||||
url: '/v1/talk/{talk_id}/report',
|
||||
...options,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...options.headers
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 이 글 쓴 사람의 글 안 보기
|
||||
*/
|
||||
export const blockTalkAuthor = <ThrowOnError extends boolean = true>(options: Options<BlockTalkAuthorData, ThrowOnError>): RequestResult<BlockTalkAuthorResponses, BlockTalkAuthorErrors, ThrowOnError> => (options.client ?? client).post<BlockTalkAuthorResponses, BlockTalkAuthorErrors, ThrowOnError>({ url: '/v1/talk/{talk_id}/block', ...options });
|
||||
|
||||
/**
|
||||
* 워치 한 번에: 지금 날씨, 각 1~7위·내 각, 노을, 남은 3시간 칸, 컴플리케이션 시간표
|
||||
*/
|
||||
@@ -238,6 +371,21 @@ export const getTodayPage = <ThrowOnError extends boolean = true>(options: Optio
|
||||
*/
|
||||
export const getTodayGuPage = <ThrowOnError extends boolean = true>(options: Options<GetTodayGuPageData, ThrowOnError>): RequestResult<GetTodayGuPageResponses, GetTodayGuPageErrors, ThrowOnError> => (options.client ?? client).get<GetTodayGuPageResponses, GetTodayGuPageErrors, ThrowOnError>({ url: '/v1/seo/today/{sido}/{place}/{gu}', ...options });
|
||||
|
||||
/**
|
||||
* 지역 내일 날씨 페이지: 정적 HTML 에 내일 예보를 채운다 (nginx 가 /tomorrow/... 를 넘김)
|
||||
*/
|
||||
export const getTomorrowPage = <ThrowOnError extends boolean = true>(options: Options<GetTomorrowPageData, ThrowOnError>): RequestResult<GetTomorrowPageResponses, GetTomorrowPageErrors, ThrowOnError> => (options.client ?? client).get<GetTomorrowPageResponses, GetTomorrowPageErrors, ThrowOnError>({ url: '/v1/seo/tomorrow/{sido}/{place}', ...options });
|
||||
|
||||
/**
|
||||
* 구로 나뉜 시의 구 내일 날씨 페이지
|
||||
*/
|
||||
export const getTomorrowGuPage = <ThrowOnError extends boolean = true>(options: Options<GetTomorrowGuPageData, ThrowOnError>): RequestResult<GetTomorrowGuPageResponses, GetTomorrowGuPageErrors, ThrowOnError> => (options.client ?? client).get<GetTomorrowGuPageResponses, GetTomorrowGuPageErrors, ThrowOnError>({ url: '/v1/seo/tomorrow/{sido}/{place}/{gu}', ...options });
|
||||
|
||||
/**
|
||||
* 만든 카드뉴스 목록 (관리자). 다시 내려받거나 올릴 때
|
||||
*/
|
||||
export const listCards = <ThrowOnError extends boolean = true>(options?: Options<ListCardsData, ThrowOnError>): RequestResult<ListCardsResponses, ListCardsErrors, ThrowOnError> => (options?.client ?? client).get<ListCardsResponses, ListCardsErrors, ThrowOnError>({ url: '/v1/card', ...options });
|
||||
|
||||
/**
|
||||
* 카드뉴스 저장 (관리자). publish 면 바로 그날 피드에 올린다
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user