@clickcns/vmedic-react 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/common/index.d.ts +1 -0
- package/dist/api/common/user-notifications.d.ts +10 -0
- package/dist/cjs/api/index.js +1 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/hooks.feedbacks/index.js +2 -0
- package/dist/cjs/hooks.feedbacks/index.js.map +1 -0
- package/dist/cjs/hooks.user-notifications/index.js +2 -0
- package/dist/cjs/hooks.user-notifications/index.js.map +1 -0
- package/dist/cjs/ui/index.js +1 -1
- package/dist/cjs/ui/index.js.map +1 -1
- package/dist/es/api/index.js +53 -111
- package/dist/es/api/index.js.map +1 -1
- package/dist/es/hooks.feedbacks/index.js +67 -0
- package/dist/es/hooks.feedbacks/index.js.map +1 -0
- package/dist/es/hooks.user-notifications/index.js +42 -0
- package/dist/es/hooks.user-notifications/index.js.map +1 -0
- package/dist/es/ui/index.js +1 -1
- package/dist/es/ui/index.js.map +1 -1
- package/dist/feedback-BbDeqNIh.js +69 -0
- package/dist/feedback-BbDeqNIh.js.map +1 -0
- package/dist/feedback-xoeZc8ns.cjs +2 -0
- package/dist/feedback-xoeZc8ns.cjs.map +1 -0
- package/dist/hooks/feedbacks/index.d.ts +10 -0
- package/dist/hooks/user-notifications/index.d.ts +7 -0
- package/dist/shadcn-ui/resizable.d.ts +1 -1
- package/dist/types/api/feedback.d.ts +6 -3
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/notifications.d.ts +11 -0
- package/dist/user-notifications-DbJeK8gS.js +10 -0
- package/dist/user-notifications-DbJeK8gS.js.map +1 -0
- package/dist/user-notifications-eaEdb3_1.cjs +2 -0
- package/dist/user-notifications-eaEdb3_1.cjs.map +1 -0
- package/package.json +16 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import f from "axios";
|
|
2
|
+
let t;
|
|
3
|
+
const b = ({
|
|
4
|
+
baseURL: e,
|
|
5
|
+
timeout: s = 12e4,
|
|
6
|
+
withCredentials: o = !0,
|
|
7
|
+
headers: c,
|
|
8
|
+
getAccessToken: i,
|
|
9
|
+
getRefreshAccessToken: p,
|
|
10
|
+
onUnauthorized: u,
|
|
11
|
+
onRefreshTokenSuccess: d,
|
|
12
|
+
...m
|
|
13
|
+
}) => (t = f.create({
|
|
14
|
+
baseURL: e,
|
|
15
|
+
timeout: s,
|
|
16
|
+
withCredentials: o,
|
|
17
|
+
headers: c || {
|
|
18
|
+
"Content-Type": "application/json"
|
|
19
|
+
},
|
|
20
|
+
...m
|
|
21
|
+
}), t.interceptors.request.use((a) => {
|
|
22
|
+
const r = i();
|
|
23
|
+
return r && (a.headers.Authorization = `Bearer ${r}`), a;
|
|
24
|
+
}, (a) => Promise.reject(a)), t.interceptors.response.use((a) => a, async (a) => {
|
|
25
|
+
const r = a.config;
|
|
26
|
+
if (r.url?.includes("/auth/login"))
|
|
27
|
+
return Promise.reject(a);
|
|
28
|
+
if (a.response?.status === 401 && !r._retry) {
|
|
29
|
+
r._retry = !0;
|
|
30
|
+
try {
|
|
31
|
+
const n = await p();
|
|
32
|
+
if (!n)
|
|
33
|
+
throw new Error("Failed to refresh access token");
|
|
34
|
+
return r.headers.Authorization = `Bearer ${n}`, d(n), t(r);
|
|
35
|
+
} catch (n) {
|
|
36
|
+
return u(), Promise.reject(n);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return Promise.reject(a);
|
|
40
|
+
}), t), l = {
|
|
41
|
+
// 피드백 목록 조회 (페이지네이션)
|
|
42
|
+
listFeedbacks: async (e) => (await t.post("/feedbacks/page", {
|
|
43
|
+
page: e.page ?? 1,
|
|
44
|
+
count: e.count ?? 30,
|
|
45
|
+
status: e.status
|
|
46
|
+
})).data,
|
|
47
|
+
// 피드백 상세 조회
|
|
48
|
+
getFeedback: async (e) => (await t.get(`/feedbacks/${e}`)).data,
|
|
49
|
+
// 피드백 생성
|
|
50
|
+
createFeedback: async (e) => (await t.post("/feedbacks", e)).data,
|
|
51
|
+
// 피드백 수정
|
|
52
|
+
updateFeedback: async (e, s) => (await t.put(`/feedbacks/${e}`, s)).data,
|
|
53
|
+
// 피드백 삭제
|
|
54
|
+
deleteFeedback: async (e) => (await t.delete(`/feedbacks/${e}`)).data,
|
|
55
|
+
// 피드백 댓글 목록 조회
|
|
56
|
+
getComments: async (e) => (await t.get(`/feedbacks/${e}/comments`)).data,
|
|
57
|
+
// 피드백 댓글 작성
|
|
58
|
+
createComment: async (e, s) => (await t.post(`/feedbacks/${e}/comments`, s)).data,
|
|
59
|
+
// 피드백 댓글 삭제
|
|
60
|
+
deleteComment: async (e) => (await t.delete(`/feedbacks/comments/${e}`)).data,
|
|
61
|
+
// 피드백 댓글 수정
|
|
62
|
+
updateComment: async (e, s) => (await t.put(`/feedbacks/comments/${e}`, s)).data
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
t as a,
|
|
66
|
+
l as f,
|
|
67
|
+
b as i
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=feedback-BbDeqNIh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-BbDeqNIh.js","sources":["../src/api/axios/initialize-axios.ts","../src/api/common/feedback.ts"],"sourcesContent":["import axios, { type AxiosInstance, type CreateAxiosDefaults } from \"axios\";\r\n// Axios 인스턴스 생성\r\n\r\ninterface CreateAxiosArg extends CreateAxiosDefaults {\r\n baseURL: string;\r\n getAccessToken: () => string | null;\r\n getRefreshAccessToken: () => Promise<string | undefined>;\r\n onUnauthorized: () => void;\r\n onRefreshTokenSuccess: (newAccessToken: string) => void;\r\n}\r\n\r\nexport let apiClient: AxiosInstance;\r\n\r\nexport const initializeAxios = ({\r\n baseURL,\r\n timeout = 120_000,\r\n withCredentials = true,\r\n headers,\r\n getAccessToken,\r\n getRefreshAccessToken,\r\n onUnauthorized,\r\n onRefreshTokenSuccess,\r\n ...props\r\n}: CreateAxiosArg) => {\r\n apiClient = axios.create({\r\n baseURL,\r\n timeout,\r\n withCredentials,\r\n headers: headers || {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n ...props,\r\n });\r\n\r\n apiClient.interceptors.request.use(\r\n (config) => {\r\n const token = getAccessToken();\r\n if (token) {\r\n config.headers.Authorization = `Bearer ${token}`;\r\n }\r\n return config;\r\n },\r\n (error) => {\r\n return Promise.reject(error);\r\n }\r\n );\r\n\r\n // 응답 인터셉터 - Token 만료 시 자동 갱신\r\n apiClient.interceptors.response.use(\r\n (response) => {\r\n return response;\r\n },\r\n async (error) => {\r\n const originalRequest = error.config;\r\n\r\n // 로그인 요청은 인터셉터에서 처리하지 않음\r\n if (originalRequest.url?.includes(\"/auth/login\")) {\r\n return Promise.reject(error);\r\n }\r\n\r\n if (error.response?.status === 401 && !originalRequest._retry) {\r\n originalRequest._retry = true;\r\n\r\n try {\r\n // fetch 기반 refreshAccessToken 사용 (쿠키 자동 전송)\r\n const accessToken = await getRefreshAccessToken();\r\n if (!accessToken) {\r\n throw new Error(\"Failed to refresh access token\");\r\n }\r\n // 원래 요청 재시도\r\n originalRequest.headers.Authorization = `Bearer ${accessToken}`;\r\n onRefreshTokenSuccess(accessToken);\r\n return apiClient(originalRequest);\r\n } catch (refreshError) {\r\n // Refresh 실패 시 토큰만 정리하고 리다이렉트는 하지 않음\r\n onUnauthorized();\r\n return Promise.reject(refreshError);\r\n }\r\n }\r\n\r\n return Promise.reject(error);\r\n }\r\n );\r\n return apiClient;\r\n};\r\n","import { apiClient } from \"../../api/axios\";\r\nimport type {\r\n Feedback,\r\n FeedbackListResponse,\r\n FeedbackListRequest,\r\n CreateFeedbackRequest,\r\n FeedbackComment,\r\n FeedbackCommentsResponse,\r\n CreateFeedbackCommentRequest,\r\n} from \"../../types\";\r\n\r\nexport const feedbackApi = {\r\n // 피드백 목록 조회 (페이지네이션)\r\n listFeedbacks: async (\r\n params: FeedbackListRequest\r\n ): Promise<FeedbackListResponse> => {\r\n const response = await apiClient.post<FeedbackListResponse>(\r\n \"/feedbacks/page\",\r\n {\r\n page: params.page ?? 1,\r\n count: params.count ?? 30,\r\n status: params.status,\r\n }\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 상세 조회\r\n getFeedback: async (id: string): Promise<Feedback> => {\r\n const response = await apiClient.get<Feedback>(`/feedbacks/${id}`);\r\n return response.data;\r\n },\r\n\r\n // 피드백 생성\r\n createFeedback: async (data: CreateFeedbackRequest): Promise<Feedback> => {\r\n const response = await apiClient.post<Feedback>(\"/feedbacks\", data);\r\n return response.data;\r\n },\r\n\r\n // 피드백 수정\r\n updateFeedback: async (\r\n id: string,\r\n data: Partial<CreateFeedbackRequest> & { status?: \"pending\" | \"resolved\" }\r\n ): Promise<Feedback> => {\r\n const response = await apiClient.put<Feedback>(`/feedbacks/${id}`, data);\r\n return response.data;\r\n },\r\n\r\n // 피드백 삭제\r\n deleteFeedback: async (id: string): Promise<{ success: boolean }> => {\r\n const response = await apiClient.delete<{ success: boolean }>(\r\n `/feedbacks/${id}`\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 목록 조회\r\n getComments: async (\r\n feedbackId: string\r\n ): Promise<FeedbackCommentsResponse> => {\r\n const response = await apiClient.get<FeedbackCommentsResponse>(\r\n `/feedbacks/${feedbackId}/comments`\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 작성\r\n createComment: async (\r\n feedbackId: string,\r\n data: CreateFeedbackCommentRequest\r\n ): Promise<FeedbackComment> => {\r\n const response = await apiClient.post<FeedbackComment>(\r\n `/feedbacks/${feedbackId}/comments`,\r\n data\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 삭제\r\n deleteComment: async (commentId: string): Promise<{ success: boolean }> => {\r\n const response = await apiClient.delete<{ success: boolean }>(\r\n `/feedbacks/comments/${commentId}`\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 수정\r\n updateComment: async (\r\n commentId: string,\r\n data: CreateFeedbackCommentRequest\r\n ): Promise<FeedbackComment> => {\r\n const response = await apiClient.put<FeedbackComment>(\r\n `/feedbacks/comments/${commentId}`,\r\n data\r\n );\r\n return response.data;\r\n },\r\n};\r\n"],"names":["apiClient","initializeAxios","baseURL","timeout","withCredentials","headers","getAccessToken","getRefreshAccessToken","onUnauthorized","onRefreshTokenSuccess","props","axios","create","interceptors","request","use","config","token","Authorization","error","Promise","reject","response","originalRequest","url","includes","status","_retry","accessToken","Error","refreshError","feedbackApi","listFeedbacks","params","post","page","count","data","getFeedback","id","get","createFeedback","updateFeedback","put","deleteFeedback","delete","getComments","feedbackId","createComment","deleteComment","commentId","updateComment"],"mappings":";AAWO,IAAIA;AAEJ,MAAMC,IAAkBA,CAAC;AAAA,EAC9BC,SAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACVC,iBAAAA,IAAkB;AAAA,EAClBC,SAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,uBAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,uBAAAA;AAAAA,EACA,GAAGC;AACW,OACdV,IAAYW,EAAMC,OAAO;AAAA,EACvBV,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,SAASA,KAAW;AAAA,IAClB,gBAAgB;AAAA,EAAA;AAAA,EAElB,GAAGK;AAAAA,CACJ,GAEDV,EAAUa,aAAaC,QAAQC,IAC5BC,CAAAA,MAAW;AACV,QAAMC,IAAQX,EAAAA;AACd,SAAIW,MACFD,EAAOX,QAAQa,gBAAgB,UAAUD,CAAK,KAEzCD;AACT,GACCG,CAAAA,MACQC,QAAQC,OAAOF,CAAK,CAE/B,GAGAnB,EAAUa,aAAaS,SAASP,IAC7BO,CAAAA,MACQA,GAET,OAAOH,MAAU;AACf,QAAMI,IAAkBJ,EAAMH;AAG9B,MAAIO,EAAgBC,KAAKC,SAAS,aAAa;AAC7C,WAAOL,QAAQC,OAAOF,CAAK;AAG7B,MAAIA,EAAMG,UAAUI,W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Ae,OAAOC,OACH,MAAMlD,EAAU6C,OAC/B,uBAAuBK,CAAS,EAClC,GACgBb;AAAAA;AAAAA,EAIlBc,eAAe,OACbD,GACAb,OAEiB,MAAMrC,EAAU2C,IAC/B,uBAAuBO,CAAS,IAChCb,CACF,GACgBA;AAEpB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const l=require("axios");exports.apiClient=void 0;const C=({baseURL:e,timeout:t=12e4,withCredentials:r=!0,headers:i,getAccessToken:o,getRefreshAccessToken:c,onUnauthorized:p,onRefreshTokenSuccess:u,...d})=>(exports.apiClient=l.create({baseURL:e,timeout:t,withCredentials:r,headers:i||{"Content-Type":"application/json"},...d}),exports.apiClient.interceptors.request.use(s=>{const a=o();return a&&(s.headers.Authorization=`Bearer ${a}`),s},s=>Promise.reject(s)),exports.apiClient.interceptors.response.use(s=>s,async s=>{const a=s.config;if(a.url?.includes("/auth/login"))return Promise.reject(s);if(s.response?.status===401&&!a._retry){a._retry=!0;try{const n=await c();if(!n)throw new Error("Failed to refresh access token");return a.headers.Authorization=`Bearer ${n}`,u(n),exports.apiClient(a)}catch(n){return p(),Promise.reject(n)}}return Promise.reject(s)}),exports.apiClient),k={listFeedbacks:async e=>(await exports.apiClient.post("/feedbacks/page",{page:e.page??1,count:e.count??30,status:e.status})).data,getFeedback:async e=>(await exports.apiClient.get(`/feedbacks/${e}`)).data,createFeedback:async e=>(await exports.apiClient.post("/feedbacks",e)).data,updateFeedback:async(e,t)=>(await exports.apiClient.put(`/feedbacks/${e}`,t)).data,deleteFeedback:async e=>(await exports.apiClient.delete(`/feedbacks/${e}`)).data,getComments:async e=>(await exports.apiClient.get(`/feedbacks/${e}/comments`)).data,createComment:async(e,t)=>(await exports.apiClient.post(`/feedbacks/${e}/comments`,t)).data,deleteComment:async e=>(await exports.apiClient.delete(`/feedbacks/comments/${e}`)).data,updateComment:async(e,t)=>(await exports.apiClient.put(`/feedbacks/comments/${e}`,t)).data};exports.feedbackApi=k;exports.initializeAxios=C;
|
|
2
|
+
//# sourceMappingURL=feedback-xoeZc8ns.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-xoeZc8ns.cjs","sources":["../src/api/axios/initialize-axios.ts","../src/api/common/feedback.ts"],"sourcesContent":["import axios, { type AxiosInstance, type CreateAxiosDefaults } from \"axios\";\r\n// Axios 인스턴스 생성\r\n\r\ninterface CreateAxiosArg extends CreateAxiosDefaults {\r\n baseURL: string;\r\n getAccessToken: () => string | null;\r\n getRefreshAccessToken: () => Promise<string | undefined>;\r\n onUnauthorized: () => void;\r\n onRefreshTokenSuccess: (newAccessToken: string) => void;\r\n}\r\n\r\nexport let apiClient: AxiosInstance;\r\n\r\nexport const initializeAxios = ({\r\n baseURL,\r\n timeout = 120_000,\r\n withCredentials = true,\r\n headers,\r\n getAccessToken,\r\n getRefreshAccessToken,\r\n onUnauthorized,\r\n onRefreshTokenSuccess,\r\n ...props\r\n}: CreateAxiosArg) => {\r\n apiClient = axios.create({\r\n baseURL,\r\n timeout,\r\n withCredentials,\r\n headers: headers || {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n ...props,\r\n });\r\n\r\n apiClient.interceptors.request.use(\r\n (config) => {\r\n const token = getAccessToken();\r\n if (token) {\r\n config.headers.Authorization = `Bearer ${token}`;\r\n }\r\n return config;\r\n },\r\n (error) => {\r\n return Promise.reject(error);\r\n }\r\n );\r\n\r\n // 응답 인터셉터 - Token 만료 시 자동 갱신\r\n apiClient.interceptors.response.use(\r\n (response) => {\r\n return response;\r\n },\r\n async (error) => {\r\n const originalRequest = error.config;\r\n\r\n // 로그인 요청은 인터셉터에서 처리하지 않음\r\n if (originalRequest.url?.includes(\"/auth/login\")) {\r\n return Promise.reject(error);\r\n }\r\n\r\n if (error.response?.status === 401 && !originalRequest._retry) {\r\n originalRequest._retry = true;\r\n\r\n try {\r\n // fetch 기반 refreshAccessToken 사용 (쿠키 자동 전송)\r\n const accessToken = await getRefreshAccessToken();\r\n if (!accessToken) {\r\n throw new Error(\"Failed to refresh access token\");\r\n }\r\n // 원래 요청 재시도\r\n originalRequest.headers.Authorization = `Bearer ${accessToken}`;\r\n onRefreshTokenSuccess(accessToken);\r\n return apiClient(originalRequest);\r\n } catch (refreshError) {\r\n // Refresh 실패 시 토큰만 정리하고 리다이렉트는 하지 않음\r\n onUnauthorized();\r\n return Promise.reject(refreshError);\r\n }\r\n }\r\n\r\n return Promise.reject(error);\r\n }\r\n );\r\n return apiClient;\r\n};\r\n","import { apiClient } from \"../../api/axios\";\r\nimport type {\r\n Feedback,\r\n FeedbackListResponse,\r\n FeedbackListRequest,\r\n CreateFeedbackRequest,\r\n FeedbackComment,\r\n FeedbackCommentsResponse,\r\n CreateFeedbackCommentRequest,\r\n} from \"../../types\";\r\n\r\nexport const feedbackApi = {\r\n // 피드백 목록 조회 (페이지네이션)\r\n listFeedbacks: async (\r\n params: FeedbackListRequest\r\n ): Promise<FeedbackListResponse> => {\r\n const response = await apiClient.post<FeedbackListResponse>(\r\n \"/feedbacks/page\",\r\n {\r\n page: params.page ?? 1,\r\n count: params.count ?? 30,\r\n status: params.status,\r\n }\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 상세 조회\r\n getFeedback: async (id: string): Promise<Feedback> => {\r\n const response = await apiClient.get<Feedback>(`/feedbacks/${id}`);\r\n return response.data;\r\n },\r\n\r\n // 피드백 생성\r\n createFeedback: async (data: CreateFeedbackRequest): Promise<Feedback> => {\r\n const response = await apiClient.post<Feedback>(\"/feedbacks\", data);\r\n return response.data;\r\n },\r\n\r\n // 피드백 수정\r\n updateFeedback: async (\r\n id: string,\r\n data: Partial<CreateFeedbackRequest> & { status?: \"pending\" | \"resolved\" }\r\n ): Promise<Feedback> => {\r\n const response = await apiClient.put<Feedback>(`/feedbacks/${id}`, data);\r\n return response.data;\r\n },\r\n\r\n // 피드백 삭제\r\n deleteFeedback: async (id: string): Promise<{ success: boolean }> => {\r\n const response = await apiClient.delete<{ success: boolean }>(\r\n `/feedbacks/${id}`\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 목록 조회\r\n getComments: async (\r\n feedbackId: string\r\n ): Promise<FeedbackCommentsResponse> => {\r\n const response = await apiClient.get<FeedbackCommentsResponse>(\r\n `/feedbacks/${feedbackId}/comments`\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 작성\r\n createComment: async (\r\n feedbackId: string,\r\n data: CreateFeedbackCommentRequest\r\n ): Promise<FeedbackComment> => {\r\n const response = await apiClient.post<FeedbackComment>(\r\n `/feedbacks/${feedbackId}/comments`,\r\n data\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 삭제\r\n deleteComment: async (commentId: string): Promise<{ success: boolean }> => {\r\n const response = await apiClient.delete<{ success: boolean }>(\r\n `/feedbacks/comments/${commentId}`\r\n );\r\n return response.data;\r\n },\r\n\r\n // 피드백 댓글 수정\r\n updateComment: async (\r\n commentId: string,\r\n data: CreateFeedbackCommentRequest\r\n ): Promise<FeedbackComment> => {\r\n const response = await apiClient.put<FeedbackComment>(\r\n `/feedbacks/comments/${commentId}`,\r\n data\r\n );\r\n return response.data;\r\n },\r\n};\r\n"],"names":["apiClient","initializeAxios","baseURL","timeout","withCredentials","headers","getAccessToken","getRefreshAccessToken","onUnauthorized","onRefreshTokenSuccess","props","axios","create","interceptors","request","use","config","token","Authorization","error","Promise","reject","response","originalRequest","url","includes","status","_retry","accessToken","Error","refreshError","feedbackApi","listFeedbacks","params","post","page","count","data","getFeedback","id","get","createFeedback","updateFeedback","put","deleteFeedback","delete","getComments","feedbackId","createComment","deleteComment","commentId","updateComment"],"mappings":"sCAWWA,QAAAA,UAAAA,OAEJ,MAAMC,EAAkBA,CAAC,CAC9BC,QAAAA,EACAC,QAAAA,EAAU,KACVC,gBAAAA,EAAkB,GAClBC,QAAAA,EACAC,eAAAA,EACAC,sBAAAA,EACAC,eAAAA,EACAC,sBAAAA,EACA,GAAGC,CACW,KACdV,QAAAA,UAA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G,CAAI,GAClDA,KAIlBK,eAAgB,MACdH,EACAF,KAEiB,MAAMrC,QAAAA,UAAU2C,IAAc,cAAcJ,CAAE,GAAIF,CAAI,GACvDA,KAIlBO,eAAgB,MAAOL,IACJ,MAAMvC,kBAAU6C,OAC/B,cAAcN,CAAE,EAClB,GACgBF,KAIlBS,YAAa,MACXC,IAEiB,MAAM/C,kBAAUwC,IAC/B,cAAcO,CAAU,WAC1B,GACgBV,KAIlBW,cAAe,MACbD,EACAV,KAEiB,MAAMrC,QAAAA,UAAUkC,KAC/B,cAAca,CAAU,YACxBV,CACF,GACgBA,KAIlBY,cAAe,MAAOC,IACH,MAAMlD,kBAAU6C,OAC/B,uBAAuBK,CAAS,EAClC,GACgBb,KAIlBc,cAAe,MACbD,EACAb,KAEiB,MAAMrC,QAAAA,UAAU2C,IAC/B,uBAAuBO,CAAS,GAChCb,CACF,GACgBA,IAEpB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FeedbackListRequest } from '@clickcns/vmedic-react/types';
|
|
2
|
+
export declare const FEEDBACKS_QUERY_KEY: string[];
|
|
3
|
+
interface UseFeedbacksParams extends FeedbackListRequest {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const useFeedbacks: ({ enabled, ...params }?: UseFeedbacksParams) => import('@tanstack/react-query').UseQueryResult<import('../../types').FeedbackListResponse, Error>;
|
|
7
|
+
export declare const useFeedbackComments: (feedbackId: string | null) => import('@tanstack/react-query').UseQueryResult<import('../../types').FeedbackCommentsResponse, Error>;
|
|
8
|
+
export declare const useFeedbackDetail: (id: string | null) => import('@tanstack/react-query').UseQueryResult<import('../../types').Feedback, Error>;
|
|
9
|
+
export declare const useCreateFeedback: () => import('@tanstack/react-query').UseMutationResult<import('../../types').Feedback, Error, CreateFeedbackRequest, unknown>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useUserNotifications: () => import('@tanstack/react-query').UseQueryResult<import('../../types').UserNotificationListResponse, Error>;
|
|
2
|
+
export declare const useUnreadNotificationCount: () => import('@tanstack/react-query').UseQueryResult<{
|
|
3
|
+
count: number;
|
|
4
|
+
}, Error>;
|
|
5
|
+
export declare const useMarkAsRead: () => import('@tanstack/react-query').UseMutationResult<void, Error, {
|
|
6
|
+
targetId: string;
|
|
7
|
+
}, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
2
2
|
declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const ResizablePanel: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLInputElement | HTMLObjectElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLLabelElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLIElement |
|
|
3
|
+
declare const ResizablePanel: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLInputElement | HTMLObjectElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLLabelElement | HTMLMapElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLSlotElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
4
4
|
className?: string;
|
|
5
5
|
collapsedSize?: number | undefined;
|
|
6
6
|
collapsible?: boolean | undefined;
|
|
@@ -11,15 +11,18 @@ export interface FeedbackDetail {
|
|
|
11
11
|
export interface Feedback {
|
|
12
12
|
id: string;
|
|
13
13
|
userId: string;
|
|
14
|
-
status:
|
|
14
|
+
status: "pending" | "resolved";
|
|
15
15
|
userName: string;
|
|
16
16
|
institutionName: string | null;
|
|
17
17
|
createdAt: string;
|
|
18
18
|
updatedAt: string;
|
|
19
19
|
feedbackDetail: FeedbackDetail;
|
|
20
20
|
}
|
|
21
|
+
export interface FeedbackExtended extends Feedback {
|
|
22
|
+
unreadNotificationCount: number;
|
|
23
|
+
}
|
|
21
24
|
export interface FeedbackListResponse {
|
|
22
|
-
feedbacks:
|
|
25
|
+
feedbacks: FeedbackExtended[];
|
|
23
26
|
currentPage: number;
|
|
24
27
|
totalPages: number;
|
|
25
28
|
totalCount: number;
|
|
@@ -27,7 +30,7 @@ export interface FeedbackListResponse {
|
|
|
27
30
|
export interface FeedbackListRequest {
|
|
28
31
|
page?: number;
|
|
29
32
|
count?: number;
|
|
30
|
-
status?:
|
|
33
|
+
status?: "pending" | "resolved";
|
|
31
34
|
}
|
|
32
35
|
export interface CreateFeedbackRequest {
|
|
33
36
|
feedbackDetail: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface UserNotification {
|
|
2
|
+
id: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
targetId: string;
|
|
5
|
+
targetType: "feedback" | "notice";
|
|
6
|
+
title: string;
|
|
7
|
+
isRead: boolean;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
}
|
|
10
|
+
export interface UserNotificationListResponse extends Array<UserNotification> {
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a } from "./feedback-BbDeqNIh.js";
|
|
2
|
+
const e = {
|
|
3
|
+
getNotifications: async () => (await a.get("/user-notifications")).data,
|
|
4
|
+
markAsRead: async (t) => (await a.patch("/user-notifications/mark/read", t)).data,
|
|
5
|
+
getUnreadNotificationCount: async () => (await a.get("/user-notifications/unread/count")).data
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as u
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=user-notifications-DbJeK8gS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-notifications-DbJeK8gS.js","sources":["../src/api/common/user-notifications.ts"],"sourcesContent":["import type { UserNotificationListResponse } from \"../../types\";\r\nimport { apiClient } from \"../axios\";\r\n\r\nexport const userNotificationsApi = {\r\n getNotifications: async (): Promise<UserNotificationListResponse> => {\r\n const response = await apiClient.get(\"/user-notifications\");\r\n return response.data;\r\n },\r\n\r\n markAsRead: async (request: { targetId: string }): Promise<void> => {\r\n const response = await apiClient.patch(`/user-notifications/mark/read`, request);\r\n return response.data;\r\n },\r\n\r\n getUnreadNotificationCount: async (): Promise<{ count: number }> => {\r\n const response = await apiClient.get(\"/user-notifications/unread/count\");\r\n return response.data;\r\n },\r\n};\r\n"],"names":["userNotificationsApi","getNotifications","apiClient","get","data","markAsRead","request","patch","getUnreadNotificationCount"],"mappings":";AAGO,MAAMA,IAAuB;AAAA,EAClCC,kBAAkB,aACC,MAAMC,EAAUC,IAAI,qBAAqB,GAC1CC;AAAAA,EAGlBC,YAAY,OAAOC,OACA,MAAMJ,EAAUK,MAAM,iCAAiCD,CAAO,GAC/DF;AAAAA,EAGlBI,4BAA4B,aACT,MAAMN,EAAUC,IAAI,kCAAkC,GACvDC;AAEpB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("./feedback-xoeZc8ns.cjs"),i={getNotifications:async()=>(await e.apiClient.get("/user-notifications")).data,markAsRead:async t=>(await e.apiClient.patch("/user-notifications/mark/read",t)).data,getUnreadNotificationCount:async()=>(await e.apiClient.get("/user-notifications/unread/count")).data};exports.userNotificationsApi=i;
|
|
2
|
+
//# sourceMappingURL=user-notifications-eaEdb3_1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-notifications-eaEdb3_1.cjs","sources":["../src/api/common/user-notifications.ts"],"sourcesContent":["import type { UserNotificationListResponse } from \"../../types\";\r\nimport { apiClient } from \"../axios\";\r\n\r\nexport const userNotificationsApi = {\r\n getNotifications: async (): Promise<UserNotificationListResponse> => {\r\n const response = await apiClient.get(\"/user-notifications\");\r\n return response.data;\r\n },\r\n\r\n markAsRead: async (request: { targetId: string }): Promise<void> => {\r\n const response = await apiClient.patch(`/user-notifications/mark/read`, request);\r\n return response.data;\r\n },\r\n\r\n getUnreadNotificationCount: async (): Promise<{ count: number }> => {\r\n const response = await apiClient.get(\"/user-notifications/unread/count\");\r\n return response.data;\r\n },\r\n};\r\n"],"names":["userNotificationsApi","getNotifications","apiClient","get","data","markAsRead","request","patch","getUnreadNotificationCount"],"mappings":"wDAGaA,EAAuB,CAClCC,iBAAkB,UACC,MAAMC,YAAUC,IAAI,qBAAqB,GAC1CC,KAGlBC,WAAY,MAAOC,IACA,MAAMJ,EAAAA,UAAUK,MAAM,gCAAiCD,CAAO,GAC/DF,KAGlBI,2BAA4B,UACT,MAAMN,YAAUC,IAAI,kCAAkC,GACvDC,IAEpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickcns/vmedic-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "A collection of powerful utilities and components built with React and Vite",
|
|
5
5
|
"author": "clickcns",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,21 @@
|
|
|
41
41
|
"types": "./dist/shadcn-ui/index.d.ts",
|
|
42
42
|
"import": "./dist/es/shadcn-ui/index.js",
|
|
43
43
|
"require": "./dist/cjs/shadcn-ui/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./hooks": {
|
|
46
|
+
"types": "./dist/hooks/index.d.ts",
|
|
47
|
+
"import": "./dist/es/hooks/index.js",
|
|
48
|
+
"require": "./dist/cjs/hooks/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./hooks.user-notifications": {
|
|
51
|
+
"types": "./dist/hooks/user-notifications/index.d.ts",
|
|
52
|
+
"import": "./dist/es/hooks/user-notifications/index.js",
|
|
53
|
+
"require": "./dist/cjs/hooks/user-notifications/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./hooks.feedbacks": {
|
|
56
|
+
"types": "./dist/hooks/feedbacks/index.d.ts",
|
|
57
|
+
"import": "./dist/es/hooks/feedbacks/index.js",
|
|
58
|
+
"require": "./dist/cjs/hooks/feedbacks/index.js"
|
|
44
59
|
}
|
|
45
60
|
},
|
|
46
61
|
"files": [
|