@ipetsadmin/api-client 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [1.7.0] - 2026-06-12
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **`patchPetTreatmentStatus`** — `PATCH /api/v1/pets/:petId/treatments/:treatmentId/status` — body **`PatchPetTreatmentStatusBody`** (`status`, optional **`vaccinationDetails`** for completing vaccination treatments).
|
|
27
|
+
- **`createApiClient`** **`pets.patchTreatmentStatus(...)`**.
|
|
28
|
+
- **`PostPetTreatmentRequestBody`** extended with optional **`vaccinationDetails`** for retrospective completed vaccination creates.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- **Peer dependency** on **`@ipetsadmin/contracts`** is now **≥ 1.7.0** (`VaccinationCompletionInput`, **`IVaccine.sourceTreatmentId`**).
|
|
33
|
+
|
|
22
34
|
## [1.6.0] - 2026-06-12
|
|
23
35
|
|
|
24
36
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, VerifyEmailRequest, AuthUserResponse, PetResponse, CreatePetInput, TreatmentResponse, CreateTreatmentInput, DoseResponse, CreateDoseInput, AppointmentResponse, CreateAppointmentInput, AppointmentStatus, UserProfileResponse, UserAgendaResponse, TipResponse, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
|
|
1
|
+
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, VerifyEmailRequest, AuthUserResponse, PetResponse, CreatePetInput, TreatmentResponse, CreateTreatmentInput, VaccinationCompletionInput, TreatmentStatus, DoseResponse, CreateDoseInput, AppointmentResponse, CreateAppointmentInput, AppointmentStatus, UserProfileResponse, UserAgendaResponse, TipResponse, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
|
|
2
2
|
|
|
3
3
|
type HttpGet = <TResponse>(url: string, config?: unknown) => Promise<{
|
|
4
4
|
data: TResponse;
|
|
@@ -33,7 +33,13 @@ declare function getMe(http: HttpClient, accessToken: string): Promise<IApiRespo
|
|
|
33
33
|
declare function patchVerifyEmail(http: HttpClient, body: VerifyEmailRequest): Promise<IApiResponse<void>>;
|
|
34
34
|
|
|
35
35
|
type PutPetDetailsBody = Partial<Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>>;
|
|
36
|
-
type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> & Partial<Pick<CreateTreatmentInput, 'status'
|
|
36
|
+
type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> & Partial<Pick<CreateTreatmentInput, 'status'>> & {
|
|
37
|
+
vaccinationDetails?: VaccinationCompletionInput;
|
|
38
|
+
};
|
|
39
|
+
type PatchPetTreatmentStatusBody = {
|
|
40
|
+
status: TreatmentStatus;
|
|
41
|
+
vaccinationDetails?: VaccinationCompletionInput;
|
|
42
|
+
};
|
|
37
43
|
type PostPetTreatmentDoseBody = Omit<CreateDoseInput, 'treatmentId' | 'petId' | 'ownerId'> & Partial<Pick<CreateDoseInput, 'status'>>;
|
|
38
44
|
type PostPetAppointmentRequestBody = Omit<CreateAppointmentInput, 'petId'> & Partial<Pick<CreateAppointmentInput, 'status'>>;
|
|
39
45
|
type PatchPetAppointmentRequestBody = Partial<Omit<CreateAppointmentInput, 'petId' | 'ownerId' | 'status'>>;
|
|
@@ -45,6 +51,7 @@ declare function putPetDetails(http: HttpClient, accessToken: string, petId: str
|
|
|
45
51
|
declare function getPetTreatments(http: HttpClient, accessToken: string, petId: string): Promise<IApiResponse<TreatmentResponse[]>>;
|
|
46
52
|
declare function createPetTreatment(http: HttpClient, accessToken: string, petId: string, body: PostPetTreatmentRequestBody): Promise<IApiResponse<TreatmentResponse>>;
|
|
47
53
|
declare function getPetTreatment(http: HttpClient, accessToken: string, petId: string, treatmentId: string): Promise<IApiResponse<TreatmentResponse>>;
|
|
54
|
+
declare function patchPetTreatmentStatus(http: HttpClient, accessToken: string, petId: string, treatmentId: string, body: PatchPetTreatmentStatusBody): Promise<IApiResponse<TreatmentResponse>>;
|
|
48
55
|
declare function getPetTreatmentDoses(http: HttpClient, accessToken: string, petId: string, treatmentId: string): Promise<IApiResponse<DoseResponse[]>>;
|
|
49
56
|
declare function createPetTreatmentDose(http: HttpClient, accessToken: string, petId: string, treatmentId: string, body: PostPetTreatmentDoseBody): Promise<IApiResponse<DoseResponse>>;
|
|
50
57
|
declare function getPetAppointments(http: HttpClient, accessToken: string, petId: string): Promise<IApiResponse<AppointmentResponse[]>>;
|
|
@@ -93,6 +100,7 @@ interface ApiClient {
|
|
|
93
100
|
readonly getTreatments: (accessToken: string, petId: string) => ReturnType<typeof getPetTreatments>;
|
|
94
101
|
readonly createTreatment: (accessToken: string, petId: string, body: Parameters<typeof createPetTreatment>[3]) => ReturnType<typeof createPetTreatment>;
|
|
95
102
|
readonly getTreatment: (accessToken: string, petId: string, treatmentId: string) => ReturnType<typeof getPetTreatment>;
|
|
103
|
+
readonly patchTreatmentStatus: (accessToken: string, petId: string, treatmentId: string, body: Parameters<typeof patchPetTreatmentStatus>[4]) => ReturnType<typeof patchPetTreatmentStatus>;
|
|
96
104
|
readonly getTreatmentDoses: (accessToken: string, petId: string, treatmentId: string) => ReturnType<typeof getPetTreatmentDoses>;
|
|
97
105
|
readonly createTreatmentDose: (accessToken: string, petId: string, treatmentId: string, body: Parameters<typeof createPetTreatmentDose>[4]) => ReturnType<typeof createPetTreatmentDose>;
|
|
98
106
|
readonly getAppointments: (accessToken: string, petId: string) => ReturnType<typeof getPetAppointments>;
|
|
@@ -105,4 +113,4 @@ interface ApiClient {
|
|
|
105
113
|
}
|
|
106
114
|
declare function createApiClient(options: CreateApiClientOptions): ApiClient;
|
|
107
115
|
|
|
108
|
-
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpDelete, type HttpGet, type HttpPatch, type HttpPost, type HttpPut, type PatchPetAppointmentRequestBody, type PatchPetAppointmentStatusBody, type PostPetAppointmentRequestBody, type PostPetTreatmentDoseBody, type PostPetTreatmentRequestBody, type PostUserPetRequestBody, type PutPetDetailsBody, createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, getUserTip, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
|
|
116
|
+
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpDelete, type HttpGet, type HttpPatch, type HttpPost, type HttpPut, type PatchPetAppointmentRequestBody, type PatchPetAppointmentStatusBody, type PatchPetTreatmentStatusBody, type PostPetAppointmentRequestBody, type PostPetTreatmentDoseBody, type PostPetTreatmentRequestBody, type PostUserPetRequestBody, type PutPetDetailsBody, createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, getUserTip, patchPetAppointment, patchPetAppointmentStatus, patchPetTreatmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, VerifyEmailRequest, AuthUserResponse, PetResponse, CreatePetInput, TreatmentResponse, CreateTreatmentInput, DoseResponse, CreateDoseInput, AppointmentResponse, CreateAppointmentInput, AppointmentStatus, UserProfileResponse, UserAgendaResponse, TipResponse, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
|
|
1
|
+
import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, VerifyEmailRequest, AuthUserResponse, PetResponse, CreatePetInput, TreatmentResponse, CreateTreatmentInput, VaccinationCompletionInput, TreatmentStatus, DoseResponse, CreateDoseInput, AppointmentResponse, CreateAppointmentInput, AppointmentStatus, UserProfileResponse, UserAgendaResponse, TipResponse, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
|
|
2
2
|
|
|
3
3
|
type HttpGet = <TResponse>(url: string, config?: unknown) => Promise<{
|
|
4
4
|
data: TResponse;
|
|
@@ -33,7 +33,13 @@ declare function getMe(http: HttpClient, accessToken: string): Promise<IApiRespo
|
|
|
33
33
|
declare function patchVerifyEmail(http: HttpClient, body: VerifyEmailRequest): Promise<IApiResponse<void>>;
|
|
34
34
|
|
|
35
35
|
type PutPetDetailsBody = Partial<Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>>;
|
|
36
|
-
type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> & Partial<Pick<CreateTreatmentInput, 'status'
|
|
36
|
+
type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> & Partial<Pick<CreateTreatmentInput, 'status'>> & {
|
|
37
|
+
vaccinationDetails?: VaccinationCompletionInput;
|
|
38
|
+
};
|
|
39
|
+
type PatchPetTreatmentStatusBody = {
|
|
40
|
+
status: TreatmentStatus;
|
|
41
|
+
vaccinationDetails?: VaccinationCompletionInput;
|
|
42
|
+
};
|
|
37
43
|
type PostPetTreatmentDoseBody = Omit<CreateDoseInput, 'treatmentId' | 'petId' | 'ownerId'> & Partial<Pick<CreateDoseInput, 'status'>>;
|
|
38
44
|
type PostPetAppointmentRequestBody = Omit<CreateAppointmentInput, 'petId'> & Partial<Pick<CreateAppointmentInput, 'status'>>;
|
|
39
45
|
type PatchPetAppointmentRequestBody = Partial<Omit<CreateAppointmentInput, 'petId' | 'ownerId' | 'status'>>;
|
|
@@ -45,6 +51,7 @@ declare function putPetDetails(http: HttpClient, accessToken: string, petId: str
|
|
|
45
51
|
declare function getPetTreatments(http: HttpClient, accessToken: string, petId: string): Promise<IApiResponse<TreatmentResponse[]>>;
|
|
46
52
|
declare function createPetTreatment(http: HttpClient, accessToken: string, petId: string, body: PostPetTreatmentRequestBody): Promise<IApiResponse<TreatmentResponse>>;
|
|
47
53
|
declare function getPetTreatment(http: HttpClient, accessToken: string, petId: string, treatmentId: string): Promise<IApiResponse<TreatmentResponse>>;
|
|
54
|
+
declare function patchPetTreatmentStatus(http: HttpClient, accessToken: string, petId: string, treatmentId: string, body: PatchPetTreatmentStatusBody): Promise<IApiResponse<TreatmentResponse>>;
|
|
48
55
|
declare function getPetTreatmentDoses(http: HttpClient, accessToken: string, petId: string, treatmentId: string): Promise<IApiResponse<DoseResponse[]>>;
|
|
49
56
|
declare function createPetTreatmentDose(http: HttpClient, accessToken: string, petId: string, treatmentId: string, body: PostPetTreatmentDoseBody): Promise<IApiResponse<DoseResponse>>;
|
|
50
57
|
declare function getPetAppointments(http: HttpClient, accessToken: string, petId: string): Promise<IApiResponse<AppointmentResponse[]>>;
|
|
@@ -93,6 +100,7 @@ interface ApiClient {
|
|
|
93
100
|
readonly getTreatments: (accessToken: string, petId: string) => ReturnType<typeof getPetTreatments>;
|
|
94
101
|
readonly createTreatment: (accessToken: string, petId: string, body: Parameters<typeof createPetTreatment>[3]) => ReturnType<typeof createPetTreatment>;
|
|
95
102
|
readonly getTreatment: (accessToken: string, petId: string, treatmentId: string) => ReturnType<typeof getPetTreatment>;
|
|
103
|
+
readonly patchTreatmentStatus: (accessToken: string, petId: string, treatmentId: string, body: Parameters<typeof patchPetTreatmentStatus>[4]) => ReturnType<typeof patchPetTreatmentStatus>;
|
|
96
104
|
readonly getTreatmentDoses: (accessToken: string, petId: string, treatmentId: string) => ReturnType<typeof getPetTreatmentDoses>;
|
|
97
105
|
readonly createTreatmentDose: (accessToken: string, petId: string, treatmentId: string, body: Parameters<typeof createPetTreatmentDose>[4]) => ReturnType<typeof createPetTreatmentDose>;
|
|
98
106
|
readonly getAppointments: (accessToken: string, petId: string) => ReturnType<typeof getPetAppointments>;
|
|
@@ -105,4 +113,4 @@ interface ApiClient {
|
|
|
105
113
|
}
|
|
106
114
|
declare function createApiClient(options: CreateApiClientOptions): ApiClient;
|
|
107
115
|
|
|
108
|
-
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpDelete, type HttpGet, type HttpPatch, type HttpPost, type HttpPut, type PatchPetAppointmentRequestBody, type PatchPetAppointmentStatusBody, type PostPetAppointmentRequestBody, type PostPetTreatmentDoseBody, type PostPetTreatmentRequestBody, type PostUserPetRequestBody, type PutPetDetailsBody, createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, getUserTip, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
|
|
116
|
+
export { type ApiClient, type CreateApiClientOptions, type HttpClient, type HttpDelete, type HttpGet, type HttpPatch, type HttpPost, type HttpPut, type PatchPetAppointmentRequestBody, type PatchPetAppointmentStatusBody, type PatchPetTreatmentStatusBody, type PostPetAppointmentRequestBody, type PostPetTreatmentDoseBody, type PostPetTreatmentRequestBody, type PostUserPetRequestBody, type PutPetDetailsBody, createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, getUserTip, patchPetAppointment, patchPetAppointmentStatus, patchPetTreatmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
|
package/dist/index.js
CHANGED
|
@@ -100,6 +100,16 @@ async function getPetTreatment(http, accessToken, petId, treatmentId) {
|
|
|
100
100
|
);
|
|
101
101
|
return data;
|
|
102
102
|
}
|
|
103
|
+
async function patchPetTreatmentStatus(http, accessToken, petId, treatmentId, body) {
|
|
104
|
+
const { data } = await http.patch(
|
|
105
|
+
`${PETS_BASE}/${petId}/treatments/${treatmentId}/status`,
|
|
106
|
+
body,
|
|
107
|
+
{
|
|
108
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
return data;
|
|
112
|
+
}
|
|
103
113
|
async function getPetTreatmentDoses(http, accessToken, petId, treatmentId) {
|
|
104
114
|
const { data } = await http.get(
|
|
105
115
|
`${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,
|
|
@@ -249,6 +259,7 @@ function createApiClient(options) {
|
|
|
249
259
|
getTreatments: (accessToken, petId) => getPetTreatments(http, accessToken, petId),
|
|
250
260
|
createTreatment: (accessToken, petId, body) => createPetTreatment(http, accessToken, petId, body),
|
|
251
261
|
getTreatment: (accessToken, petId, treatmentId) => getPetTreatment(http, accessToken, petId, treatmentId),
|
|
262
|
+
patchTreatmentStatus: (accessToken, petId, treatmentId, body) => patchPetTreatmentStatus(http, accessToken, petId, treatmentId, body),
|
|
252
263
|
getTreatmentDoses: (accessToken, petId, treatmentId) => getPetTreatmentDoses(http, accessToken, petId, treatmentId),
|
|
253
264
|
createTreatmentDose: (accessToken, petId, treatmentId, body) => createPetTreatmentDose(http, accessToken, petId, treatmentId, body),
|
|
254
265
|
getAppointments: (accessToken, petId) => getPetAppointments(http, accessToken, petId),
|
|
@@ -282,6 +293,7 @@ exports.getUserProfile = getUserProfile;
|
|
|
282
293
|
exports.getUserTip = getUserTip;
|
|
283
294
|
exports.patchPetAppointment = patchPetAppointment;
|
|
284
295
|
exports.patchPetAppointmentStatus = patchPetAppointmentStatus;
|
|
296
|
+
exports.patchPetTreatmentStatus = patchPetTreatmentStatus;
|
|
285
297
|
exports.patchUserProfile = patchUserProfile;
|
|
286
298
|
exports.patchVerifyEmail = patchVerifyEmail;
|
|
287
299
|
exports.postGoogleOAuthCallback = postGoogleOAuthCallback;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/endpoints/auth.ts","../src/endpoints/pet.ts","../src/endpoints/user.ts","../src/endpoints/health-check.ts","../src/create-api-client.ts"],"names":[],"mappings":";;;AAeA,IAAM,SAAA,GAAY,cAAA;AAKlB,eAAsB,YAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,SAAA,CAAA;AAAA,IACZ;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT;AAKA,eAAsB,SAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,M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"index.js","sourcesContent":["import type {\n AuthSessionResponse,\n AuthUserResponse,\n IApiResponse,\n LoginRequest,\n LogoutRequest,\n OAuthGoogleCallbackRequest,\n OAuthGoogleStartResponse,\n RefreshRequest,\n RegisterRequest,\n VerifyEmailRequest,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst AUTH_BASE = '/api/v1/auth' as const;\n\n/**\n * POST /api/v1/auth/register\n */\nexport async function postRegister(\n http: HttpClient,\n body: RegisterRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RegisterRequest>(\n `${AUTH_BASE}/register`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/login\n */\nexport async function postLogin(\n http: HttpClient,\n body: LoginRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, LoginRequest>(\n `${AUTH_BASE}/login`,\n body,\n );\n return data;\n}\n\n/**\n * GET /api/v1/auth/oauth/google/start?redirectUri=...\n */\nexport async function getGoogleOAuthStart(\n http: HttpClient,\n redirectUri: string,\n): Promise<IApiResponse<OAuthGoogleStartResponse>> {\n const q = new URLSearchParams({ redirectUri });\n const { data } = await http.get<IApiResponse<OAuthGoogleStartResponse>>(\n `${AUTH_BASE}/oauth/google/start?${q.toString()}`,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/oauth/google/callback\n */\nexport async function postGoogleOAuthCallback(\n http: HttpClient,\n body: OAuthGoogleCallbackRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, OAuthGoogleCallbackRequest>(\n `${AUTH_BASE}/oauth/google/callback`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/refresh\n */\nexport async function postRefresh(\n http: HttpClient,\n body: RefreshRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RefreshRequest>(\n `${AUTH_BASE}/refresh`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/logout — 204 No Content (no JSON body).\n */\nexport async function postLogout(http: HttpClient, body: LogoutRequest): Promise<void> {\n await http.post<undefined, LogoutRequest>(`${AUTH_BASE}/logout`, body);\n}\n\n/**\n * GET /api/v1/auth/me — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getMe(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<AuthUserResponse>> {\n const { data } = await http.get<IApiResponse<AuthUserResponse>>(`${AUTH_BASE}/me`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/auth/verify-email\n */\nexport async function patchVerifyEmail(\n http: HttpClient,\n body: VerifyEmailRequest,\n): Promise<IApiResponse<void>> {\n const { data } = await http.patch<IApiResponse<void>, VerifyEmailRequest>(\n `${AUTH_BASE}/verify-email`,\n body,\n );\n return data;\n}\n","import type {\n AppointmentResponse,\n AppointmentStatus,\n CreateAppointmentInput,\n CreateDoseInput,\n CreatePetInput,\n CreateTreatmentInput,\n DoseResponse,\n IApiResponse,\n PetResponse,\n TreatmentResponse,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst PETS_BASE = '/api/v1/pets' as const;\n\n/** Body for PUT /api/v1/pets/:petId (partial update; excludes server-owned fields). */\nexport type PutPetDetailsBody = Partial<\n Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>\n>;\n\n/**\n * Same fields as creating a treatment without `petId` (provided in the URL). `status` may be omitted\n * (defaults on the server).\n */\nexport type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> &\n Partial<Pick<CreateTreatmentInput, 'status'>>;\n\n/**\n * POST .../treatments/:treatmentId/doses — `treatmentId`, `petId`, and `ownerId` are not sent in JSON.\n */\nexport type PostPetTreatmentDoseBody = Omit<CreateDoseInput, 'treatmentId' | 'petId' | 'ownerId'> &\n Partial<Pick<CreateDoseInput, 'status'>>;\n\n/**\n * Same fields as creating an appointment without `petId` (provided in the URL). `status` may be omitted\n * (defaults to pending on the server).\n */\nexport type PostPetAppointmentRequestBody = Omit<CreateAppointmentInput, 'petId'> &\n Partial<Pick<CreateAppointmentInput, 'status'>>;\n\n/** Partial update for PATCH /api/v1/pets/:petId/appointments/:appointmentId (excludes status). */\nexport type PatchPetAppointmentRequestBody = Partial<\n Omit<CreateAppointmentInput, 'petId' | 'ownerId' | 'status'>\n>;\n\n/** Body for PATCH .../appointments/:appointmentId/status. */\nexport type PatchPetAppointmentStatusBody = {\n status: AppointmentStatus;\n};\n\n/**\n * GET /api/v1/pets/:petId — Bearer access token required.\n */\nexport async function getPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.get<IApiResponse<PetResponse>>(`${PETS_BASE}/${petId}`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PUT /api/v1/pets/:petId — partial update; owner must match JWT user.\n */\nexport async function putPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PutPetDetailsBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.put<IApiResponse<PetResponse>, PutPetDetailsBody>(\n `${PETS_BASE}/${petId}`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments\n */\nexport async function getPetTreatments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<TreatmentResponse[]>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse[]>>(\n `${PETS_BASE}/${petId}/treatments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments — 201 Created (`IApiResponse<TreatmentResponse>` body).\n */\nexport async function createPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetTreatmentRequestBody,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.post<IApiResponse<TreatmentResponse>, PostPetTreatmentRequestBody>(\n `${PETS_BASE}/${petId}/treatments`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId\n */\nexport async function getPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId/doses\n */\nexport async function getPetTreatmentDoses(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<DoseResponse[]>> {\n const { data } = await http.get<IApiResponse<DoseResponse[]>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments/:treatmentId/doses — 201 Created.\n */\nexport async function createPetTreatmentDose(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: PostPetTreatmentDoseBody,\n): Promise<IApiResponse<DoseResponse>> {\n const { data } = await http.post<IApiResponse<DoseResponse>, PostPetTreatmentDoseBody>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments\n */\nexport async function getPetAppointments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<AppointmentResponse[]>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse[]>>(\n `${PETS_BASE}/${petId}/appointments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/appointments — 201 Created.\n */\nexport async function createPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.post<\n IApiResponse<AppointmentResponse>,\n PostPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function getPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId — partial update (not status).\n */\nexport async function patchPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId/status\n */\nexport async function patchPetAppointmentStatus(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentStatusBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentStatusBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}/status`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * DELETE /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function deletePetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<null>> {\n const { data } = await http.delete<IApiResponse<null>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type {\n CreatePetInput,\n IApiResponse,\n PatchUserProfileInput,\n PetResponse,\n TipResponse,\n UserAgendaResponse,\n UserProfileResponse,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst USERS_BASE = '/api/v1/users' as const;\n\n/** Body for POST /users/:userId/pets (`ownerId` / timestamps come from the server). */\nexport type PostUserPetRequestBody = Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>;\n\n/**\n * GET /api/v1/users/me/tip — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserTip(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<TipResponse>> {\n const { data } = await http.get<IApiResponse<TipResponse>>(`${USERS_BASE}/me/tip`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/agenda — requires `Authorization: Bearer <accessToken>`.\n * Optional `days` query (1–30, default 7).\n */\nexport async function getUserAgenda(\n http: HttpClient,\n accessToken: string,\n days?: number,\n): Promise<IApiResponse<UserAgendaResponse>> {\n const { data } = await http.get<IApiResponse<UserAgendaResponse>>(`${USERS_BASE}/me/agenda`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n params: days !== undefined ? { days } : undefined,\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserProfile(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.get<IApiResponse<UserProfileResponse>>(`${USERS_BASE}/me/profile`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserPets(\n http: HttpClient,\n accessToken: string,\n userId: string,\n): Promise<IApiResponse<PetResponse[]>> {\n const { data } = await http.get<IApiResponse<PetResponse[]>>(`${USERS_BASE}/${userId}/pets`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * POST /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function createUserPet(\n http: HttpClient,\n accessToken: string,\n userId: string,\n body: PostUserPetRequestBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.post<IApiResponse<PetResponse>, PostUserPetRequestBody>(\n `${USERS_BASE}/${userId}/pets`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n * Body must not include `avatar` (API rejects unknown keys in strict mode).\n */\nexport async function patchUserProfile(\n http: HttpClient,\n accessToken: string,\n body: PatchUserProfileInput,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.patch<IApiResponse<UserProfileResponse>, PatchUserProfileInput>(\n `${USERS_BASE}/me/profile`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type { IApiResponse, HealthCheck } from '@ipetsadmin/contracts';\nimport type { HttpClient } from '../http-client';\n\n/** Same path as `/api/${v1}/health-check` on the server when `v1` is the string `'v1'`. */\nconst HEALTH_CHECK_PATH = '/api/v1/health-check' as const;\n\n/**\n * GET /api/v1/health-check — server liveness.\n *\n * Returns the full JSON the server sends (`IApiResponse<HealthCheck>`).\n *\n * **Why not `data.data` here?** Adapters like Axios wrap the HTTP body in a property also\n * called `data`. That outer `data` is the entire `res.json(...)` object. The inner\n * `IApiResponse.data` is the `HealthCheck` payload — use `.data` on the **returned** value,\n * e.g. `(await fetchHealthCheck(http)).data`.\n */\nexport async function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>> {\n const { data: body } = await http.get<IApiResponse<HealthCheck>>(HEALTH_CHECK_PATH);\n\n return body;\n}\n","import {\n getGoogleOAuthStart,\n getMe,\n patchVerifyEmail,\n postGoogleOAuthCallback,\n postLogin,\n postLogout,\n postRefresh,\n postRegister,\n} from './endpoints/auth';\nimport {\n createPetAppointment,\n createPetTreatment,\n createPetTreatmentDose,\n deletePetAppointment,\n getPetAppointment,\n getPetAppointments,\n getPetDetails,\n getPetTreatment,\n getPetTreatmentDoses,\n getPetTreatments,\n patchPetAppointment,\n patchPetAppointmentStatus,\n putPetDetails,\n} from './endpoints/pet';\nimport {\n createUserPet,\n getUserAgenda,\n getUserPets,\n getUserProfile,\n getUserTip,\n patchUserProfile,\n} from './endpoints/user';\nimport { fetchHealthCheck } from './endpoints/health-check';\nimport type { HttpClient } from './http-client';\n\nexport interface CreateApiClientOptions {\n /**\n * Preconfigured HTTP client (e.g. Axios instance with `baseURL` set).\n * Paths in this library are relative to that base (e.g. `/api/v1/...`).\n * `get`, `post`, `patch`, `put`, and `delete` are required for all implemented routes.\n */\n readonly http: HttpClient;\n}\n\nexport interface ApiClient {\n readonly healthCheck: () => ReturnType<typeof fetchHealthCheck>;\n readonly auth: {\n readonly register: (\n body: Parameters<typeof postRegister>[1],\n ) => ReturnType<typeof postRegister>;\n readonly login: (body: Parameters<typeof postLogin>[1]) => ReturnType<typeof postLogin>;\n readonly getGoogleOAuthStart: (redirectUri: string) => ReturnType<typeof getGoogleOAuthStart>;\n readonly postGoogleOAuthCallback: (\n body: Parameters<typeof postGoogleOAuthCallback>[1],\n ) => ReturnType<typeof postGoogleOAuthCallback>;\n readonly refresh: (body: Parameters<typeof postRefresh>[1]) => ReturnType<typeof postRefresh>;\n readonly logout: (body: Parameters<typeof postLogout>[1]) => ReturnType<typeof postLogout>;\n readonly verifyEmail: (\n body: Parameters<typeof patchVerifyEmail>[1],\n ) => ReturnType<typeof patchVerifyEmail>;\n readonly me: (accessToken: string) => ReturnType<typeof getMe>;\n };\n readonly users: {\n readonly getProfile: (accessToken: string) => ReturnType<typeof getUserProfile>;\n readonly getAgenda: (accessToken: string, days?: number) => ReturnType<typeof getUserAgenda>;\n readonly getTip: (accessToken: string) => ReturnType<typeof getUserTip>;\n readonly patchProfile: (\n accessToken: string,\n body: Parameters<typeof patchUserProfile>[2],\n ) => ReturnType<typeof patchUserProfile>;\n readonly getPets: (accessToken: string, userId: string) => ReturnType<typeof getUserPets>;\n readonly createPet: (\n accessToken: string,\n userId: string,\n body: Parameters<typeof createUserPet>[3],\n ) => ReturnType<typeof createUserPet>;\n };\n readonly pets: {\n readonly getById: (accessToken: string, petId: string) => ReturnType<typeof getPetDetails>;\n readonly update: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof putPetDetails>[3],\n ) => ReturnType<typeof putPetDetails>;\n readonly getTreatments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetTreatments>;\n readonly createTreatment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetTreatment>[3],\n ) => ReturnType<typeof createPetTreatment>;\n readonly getTreatment: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatment>;\n readonly getTreatmentDoses: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatmentDoses>;\n readonly createTreatmentDose: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: Parameters<typeof createPetTreatmentDose>[4],\n ) => ReturnType<typeof createPetTreatmentDose>;\n readonly getAppointments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetAppointments>;\n readonly createAppointment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetAppointment>[3],\n ) => ReturnType<typeof createPetAppointment>;\n readonly getAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof getPetAppointment>;\n readonly patchAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointment>[4],\n ) => ReturnType<typeof patchPetAppointment>;\n readonly patchAppointmentStatus: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointmentStatus>[4],\n ) => ReturnType<typeof patchPetAppointmentStatus>;\n readonly deleteAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof deletePetAppointment>;\n };\n}\n\n/**\n * Creates a typed API client backed by the provided HTTP implementation.\n */\nexport function createApiClient(options: CreateApiClientOptions): ApiClient {\n const { http } = options;\n\n return {\n healthCheck: () => fetchHealthCheck(http),\n auth: {\n register: (body) => postRegister(http, body),\n login: (body) => postLogin(http, body),\n getGoogleOAuthStart: (redirectUri) => getGoogleOAuthStart(http, redirectUri),\n postGoogleOAuthCallback: (body) => postGoogleOAuthCallback(http, body),\n refresh: (body) => postRefresh(http, body),\n logout: (body) => postLogout(http, body),\n verifyEmail: (body) => patchVerifyEmail(http, body),\n me: (accessToken) => getMe(http, accessToken),\n },\n users: {\n getProfile: (accessToken) => getUserProfile(http, accessToken),\n getAgenda: (accessToken, days) => getUserAgenda(http, accessToken, days),\n getTip: (accessToken) => getUserTip(http, accessToken),\n patchProfile: (accessToken, body) => patchUserProfile(http, accessToken, body),\n getPets: (accessToken, userId) => getUserPets(http, accessToken, userId),\n createPet: (accessToken, userId, body) => createUserPet(http, accessToken, userId, body),\n },\n pets: {\n getById: (accessToken, petId) => getPetDetails(http, accessToken, petId),\n update: (accessToken, petId, body) => putPetDetails(http, accessToken, petId, body),\n getTreatments: (accessToken, petId) => getPetTreatments(http, accessToken, petId),\n createTreatment: (accessToken, petId, body) =>\n createPetTreatment(http, accessToken, petId, body),\n getTreatment: (accessToken, petId, treatmentId) =>\n getPetTreatment(http, accessToken, petId, treatmentId),\n getTreatmentDoses: (accessToken, petId, treatmentId) =>\n getPetTreatmentDoses(http, accessToken, petId, treatmentId),\n createTreatmentDose: (accessToken, petId, treatmentId, body) =>\n createPetTreatmentDose(http, accessToken, petId, treatmentId, body),\n getAppointments: (accessToken, petId) => getPetAppointments(http, accessToken, petId),\n createAppointment: (accessToken, petId, body) =>\n createPetAppointment(http, accessToken, petId, body),\n getAppointment: (accessToken, petId, appointmentId) =>\n getPetAppointment(http, accessToken, petId, appointmentId),\n patchAppointment: (accessToken, petId, appointmentId, body) =>\n patchPetAppointment(http, accessToken, petId, appointmentId, body),\n patchAppointmentStatus: (accessToken, petId, appointmentId, body) =>\n patchPetAppointmentStatus(http, accessToken, petId, appointmentId, body),\n deleteAppointment: (accessToken, petId, appointmentId) =>\n deletePetAppointment(http, accessToken, petId, appointmentId),\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/endpoints/auth.ts","../src/endpoints/pet.ts","../src/endpoints/user.ts","../src/endpoints/health-check.ts","../src/create-api-client.ts"],"names":[],"mappings":";;;AAeA,IAAM,SAAA,GAAY,cAAA;AAKlB,eAAsB,YAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,SAAA,CAAA;AAAA,IACZ;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT;AAKA,eAAsB,SAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,MAAA,CAAA;AAAA,IACZ;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT;AAKA,eAAsB,mBAAA,CACpB,MACA,WAAA,EACiD;AACjD,EAAA,MAAM,CAAA,GAAI,IAAI,eAAA,CAAgB,EAAE,aAAa,CAAA;AAC7C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,GAAA;AAAA,IAC1B,CAAA,EAAG,SAAS,CAAA,oBAAA,EAAuB,CAAA,CAAE,UAAU,CAAA;AAAA,GACjD;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CAA0B,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,aAAA,EAAe,IAAI,CAAA;AAAA,MACzE,iBAAA,EAAmB,CAAC,WAAA,EAAa,KAAA,EAAO,kBACtC,oBAAA,CAAqB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,aAAa;AAAA;AAChE,GACF;AACF","file":"index.js","sourcesContent":["import type {\n AuthSessionResponse,\n AuthUserResponse,\n IApiResponse,\n LoginRequest,\n LogoutRequest,\n OAuthGoogleCallbackRequest,\n OAuthGoogleStartResponse,\n RefreshRequest,\n RegisterRequest,\n VerifyEmailRequest,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst AUTH_BASE = '/api/v1/auth' as const;\n\n/**\n * POST /api/v1/auth/register\n */\nexport async function postRegister(\n http: HttpClient,\n body: RegisterRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RegisterRequest>(\n `${AUTH_BASE}/register`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/login\n */\nexport async function postLogin(\n http: HttpClient,\n body: LoginRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, LoginRequest>(\n `${AUTH_BASE}/login`,\n body,\n );\n return data;\n}\n\n/**\n * GET /api/v1/auth/oauth/google/start?redirectUri=...\n */\nexport async function getGoogleOAuthStart(\n http: HttpClient,\n redirectUri: string,\n): Promise<IApiResponse<OAuthGoogleStartResponse>> {\n const q = new URLSearchParams({ redirectUri });\n const { data } = await http.get<IApiResponse<OAuthGoogleStartResponse>>(\n `${AUTH_BASE}/oauth/google/start?${q.toString()}`,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/oauth/google/callback\n */\nexport async function postGoogleOAuthCallback(\n http: HttpClient,\n body: OAuthGoogleCallbackRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, OAuthGoogleCallbackRequest>(\n `${AUTH_BASE}/oauth/google/callback`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/refresh\n */\nexport async function postRefresh(\n http: HttpClient,\n body: RefreshRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RefreshRequest>(\n `${AUTH_BASE}/refresh`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/logout — 204 No Content (no JSON body).\n */\nexport async function postLogout(http: HttpClient, body: LogoutRequest): Promise<void> {\n await http.post<undefined, LogoutRequest>(`${AUTH_BASE}/logout`, body);\n}\n\n/**\n * GET /api/v1/auth/me — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getMe(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<AuthUserResponse>> {\n const { data } = await http.get<IApiResponse<AuthUserResponse>>(`${AUTH_BASE}/me`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/auth/verify-email\n */\nexport async function patchVerifyEmail(\n http: HttpClient,\n body: VerifyEmailRequest,\n): Promise<IApiResponse<void>> {\n const { data } = await http.patch<IApiResponse<void>, VerifyEmailRequest>(\n `${AUTH_BASE}/verify-email`,\n body,\n );\n return data;\n}\n","import type {\n AppointmentResponse,\n AppointmentStatus,\n CreateAppointmentInput,\n CreateDoseInput,\n CreatePetInput,\n CreateTreatmentInput,\n DoseResponse,\n IApiResponse,\n PetResponse,\n TreatmentResponse,\n TreatmentStatus,\n VaccinationCompletionInput,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst PETS_BASE = '/api/v1/pets' as const;\n\n/** Body for PUT /api/v1/pets/:petId (partial update; excludes server-owned fields). */\nexport type PutPetDetailsBody = Partial<\n Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>\n>;\n\n/**\n * Same fields as creating a treatment without `petId` (provided in the URL). `status` may be omitted\n * (defaults on the server).\n */\nexport type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> &\n Partial<Pick<CreateTreatmentInput, 'status'>> & {\n vaccinationDetails?: VaccinationCompletionInput;\n };\n\n/** Body for PATCH .../treatments/:treatmentId/status. */\nexport type PatchPetTreatmentStatusBody = {\n status: TreatmentStatus;\n vaccinationDetails?: VaccinationCompletionInput;\n};\n\n/**\n * POST .../treatments/:treatmentId/doses — `treatmentId`, `petId`, and `ownerId` are not sent in JSON.\n */\nexport type PostPetTreatmentDoseBody = Omit<CreateDoseInput, 'treatmentId' | 'petId' | 'ownerId'> &\n Partial<Pick<CreateDoseInput, 'status'>>;\n\n/**\n * Same fields as creating an appointment without `petId` (provided in the URL). `status` may be omitted\n * (defaults to pending on the server).\n */\nexport type PostPetAppointmentRequestBody = Omit<CreateAppointmentInput, 'petId'> &\n Partial<Pick<CreateAppointmentInput, 'status'>>;\n\n/** Partial update for PATCH /api/v1/pets/:petId/appointments/:appointmentId (excludes status). */\nexport type PatchPetAppointmentRequestBody = Partial<\n Omit<CreateAppointmentInput, 'petId' | 'ownerId' | 'status'>\n>;\n\n/** Body for PATCH .../appointments/:appointmentId/status. */\nexport type PatchPetAppointmentStatusBody = {\n status: AppointmentStatus;\n};\n\n/**\n * GET /api/v1/pets/:petId — Bearer access token required.\n */\nexport async function getPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.get<IApiResponse<PetResponse>>(`${PETS_BASE}/${petId}`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PUT /api/v1/pets/:petId — partial update; owner must match JWT user.\n */\nexport async function putPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PutPetDetailsBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.put<IApiResponse<PetResponse>, PutPetDetailsBody>(\n `${PETS_BASE}/${petId}`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments\n */\nexport async function getPetTreatments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<TreatmentResponse[]>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse[]>>(\n `${PETS_BASE}/${petId}/treatments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments — 201 Created (`IApiResponse<TreatmentResponse>` body).\n */\nexport async function createPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetTreatmentRequestBody,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.post<IApiResponse<TreatmentResponse>, PostPetTreatmentRequestBody>(\n `${PETS_BASE}/${petId}/treatments`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId\n */\nexport async function getPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/treatments/:treatmentId/status\n */\nexport async function patchPetTreatmentStatus(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: PatchPetTreatmentStatusBody,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.patch<IApiResponse<TreatmentResponse>, PatchPetTreatmentStatusBody>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/status`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId/doses\n */\nexport async function getPetTreatmentDoses(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<DoseResponse[]>> {\n const { data } = await http.get<IApiResponse<DoseResponse[]>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments/:treatmentId/doses — 201 Created.\n */\nexport async function createPetTreatmentDose(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: PostPetTreatmentDoseBody,\n): Promise<IApiResponse<DoseResponse>> {\n const { data } = await http.post<IApiResponse<DoseResponse>, PostPetTreatmentDoseBody>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments\n */\nexport async function getPetAppointments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<AppointmentResponse[]>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse[]>>(\n `${PETS_BASE}/${petId}/appointments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/appointments — 201 Created.\n */\nexport async function createPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.post<\n IApiResponse<AppointmentResponse>,\n PostPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function getPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId — partial update (not status).\n */\nexport async function patchPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId/status\n */\nexport async function patchPetAppointmentStatus(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentStatusBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentStatusBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}/status`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * DELETE /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function deletePetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<null>> {\n const { data } = await http.delete<IApiResponse<null>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type {\n CreatePetInput,\n IApiResponse,\n PatchUserProfileInput,\n PetResponse,\n TipResponse,\n UserAgendaResponse,\n UserProfileResponse,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst USERS_BASE = '/api/v1/users' as const;\n\n/** Body for POST /users/:userId/pets (`ownerId` / timestamps come from the server). */\nexport type PostUserPetRequestBody = Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>;\n\n/**\n * GET /api/v1/users/me/tip — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserTip(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<TipResponse>> {\n const { data } = await http.get<IApiResponse<TipResponse>>(`${USERS_BASE}/me/tip`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/agenda — requires `Authorization: Bearer <accessToken>`.\n * Optional `days` query (1–30, default 7).\n */\nexport async function getUserAgenda(\n http: HttpClient,\n accessToken: string,\n days?: number,\n): Promise<IApiResponse<UserAgendaResponse>> {\n const { data } = await http.get<IApiResponse<UserAgendaResponse>>(`${USERS_BASE}/me/agenda`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n params: days !== undefined ? { days } : undefined,\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserProfile(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.get<IApiResponse<UserProfileResponse>>(`${USERS_BASE}/me/profile`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserPets(\n http: HttpClient,\n accessToken: string,\n userId: string,\n): Promise<IApiResponse<PetResponse[]>> {\n const { data } = await http.get<IApiResponse<PetResponse[]>>(`${USERS_BASE}/${userId}/pets`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * POST /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function createUserPet(\n http: HttpClient,\n accessToken: string,\n userId: string,\n body: PostUserPetRequestBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.post<IApiResponse<PetResponse>, PostUserPetRequestBody>(\n `${USERS_BASE}/${userId}/pets`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n * Body must not include `avatar` (API rejects unknown keys in strict mode).\n */\nexport async function patchUserProfile(\n http: HttpClient,\n accessToken: string,\n body: PatchUserProfileInput,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.patch<IApiResponse<UserProfileResponse>, PatchUserProfileInput>(\n `${USERS_BASE}/me/profile`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type { IApiResponse, HealthCheck } from '@ipetsadmin/contracts';\nimport type { HttpClient } from '../http-client';\n\n/** Same path as `/api/${v1}/health-check` on the server when `v1` is the string `'v1'`. */\nconst HEALTH_CHECK_PATH = '/api/v1/health-check' as const;\n\n/**\n * GET /api/v1/health-check — server liveness.\n *\n * Returns the full JSON the server sends (`IApiResponse<HealthCheck>`).\n *\n * **Why not `data.data` here?** Adapters like Axios wrap the HTTP body in a property also\n * called `data`. That outer `data` is the entire `res.json(...)` object. The inner\n * `IApiResponse.data` is the `HealthCheck` payload — use `.data` on the **returned** value,\n * e.g. `(await fetchHealthCheck(http)).data`.\n */\nexport async function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>> {\n const { data: body } = await http.get<IApiResponse<HealthCheck>>(HEALTH_CHECK_PATH);\n\n return body;\n}\n","import {\n getGoogleOAuthStart,\n getMe,\n patchVerifyEmail,\n postGoogleOAuthCallback,\n postLogin,\n postLogout,\n postRefresh,\n postRegister,\n} from './endpoints/auth';\nimport {\n createPetAppointment,\n createPetTreatment,\n createPetTreatmentDose,\n deletePetAppointment,\n getPetAppointment,\n getPetAppointments,\n getPetDetails,\n getPetTreatment,\n getPetTreatmentDoses,\n getPetTreatments,\n patchPetAppointment,\n patchPetAppointmentStatus,\n patchPetTreatmentStatus,\n putPetDetails,\n} from './endpoints/pet';\nimport {\n createUserPet,\n getUserAgenda,\n getUserPets,\n getUserProfile,\n getUserTip,\n patchUserProfile,\n} from './endpoints/user';\nimport { fetchHealthCheck } from './endpoints/health-check';\nimport type { HttpClient } from './http-client';\n\nexport interface CreateApiClientOptions {\n /**\n * Preconfigured HTTP client (e.g. Axios instance with `baseURL` set).\n * Paths in this library are relative to that base (e.g. `/api/v1/...`).\n * `get`, `post`, `patch`, `put`, and `delete` are required for all implemented routes.\n */\n readonly http: HttpClient;\n}\n\nexport interface ApiClient {\n readonly healthCheck: () => ReturnType<typeof fetchHealthCheck>;\n readonly auth: {\n readonly register: (\n body: Parameters<typeof postRegister>[1],\n ) => ReturnType<typeof postRegister>;\n readonly login: (body: Parameters<typeof postLogin>[1]) => ReturnType<typeof postLogin>;\n readonly getGoogleOAuthStart: (redirectUri: string) => ReturnType<typeof getGoogleOAuthStart>;\n readonly postGoogleOAuthCallback: (\n body: Parameters<typeof postGoogleOAuthCallback>[1],\n ) => ReturnType<typeof postGoogleOAuthCallback>;\n readonly refresh: (body: Parameters<typeof postRefresh>[1]) => ReturnType<typeof postRefresh>;\n readonly logout: (body: Parameters<typeof postLogout>[1]) => ReturnType<typeof postLogout>;\n readonly verifyEmail: (\n body: Parameters<typeof patchVerifyEmail>[1],\n ) => ReturnType<typeof patchVerifyEmail>;\n readonly me: (accessToken: string) => ReturnType<typeof getMe>;\n };\n readonly users: {\n readonly getProfile: (accessToken: string) => ReturnType<typeof getUserProfile>;\n readonly getAgenda: (accessToken: string, days?: number) => ReturnType<typeof getUserAgenda>;\n readonly getTip: (accessToken: string) => ReturnType<typeof getUserTip>;\n readonly patchProfile: (\n accessToken: string,\n body: Parameters<typeof patchUserProfile>[2],\n ) => ReturnType<typeof patchUserProfile>;\n readonly getPets: (accessToken: string, userId: string) => ReturnType<typeof getUserPets>;\n readonly createPet: (\n accessToken: string,\n userId: string,\n body: Parameters<typeof createUserPet>[3],\n ) => ReturnType<typeof createUserPet>;\n };\n readonly pets: {\n readonly getById: (accessToken: string, petId: string) => ReturnType<typeof getPetDetails>;\n readonly update: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof putPetDetails>[3],\n ) => ReturnType<typeof putPetDetails>;\n readonly getTreatments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetTreatments>;\n readonly createTreatment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetTreatment>[3],\n ) => ReturnType<typeof createPetTreatment>;\n readonly getTreatment: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatment>;\n readonly patchTreatmentStatus: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: Parameters<typeof patchPetTreatmentStatus>[4],\n ) => ReturnType<typeof patchPetTreatmentStatus>;\n readonly getTreatmentDoses: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatmentDoses>;\n readonly createTreatmentDose: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: Parameters<typeof createPetTreatmentDose>[4],\n ) => ReturnType<typeof createPetTreatmentDose>;\n readonly getAppointments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetAppointments>;\n readonly createAppointment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetAppointment>[3],\n ) => ReturnType<typeof createPetAppointment>;\n readonly getAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof getPetAppointment>;\n readonly patchAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointment>[4],\n ) => ReturnType<typeof patchPetAppointment>;\n readonly patchAppointmentStatus: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointmentStatus>[4],\n ) => ReturnType<typeof patchPetAppointmentStatus>;\n readonly deleteAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof deletePetAppointment>;\n };\n}\n\n/**\n * Creates a typed API client backed by the provided HTTP implementation.\n */\nexport function createApiClient(options: CreateApiClientOptions): ApiClient {\n const { http } = options;\n\n return {\n healthCheck: () => fetchHealthCheck(http),\n auth: {\n register: (body) => postRegister(http, body),\n login: (body) => postLogin(http, body),\n getGoogleOAuthStart: (redirectUri) => getGoogleOAuthStart(http, redirectUri),\n postGoogleOAuthCallback: (body) => postGoogleOAuthCallback(http, body),\n refresh: (body) => postRefresh(http, body),\n logout: (body) => postLogout(http, body),\n verifyEmail: (body) => patchVerifyEmail(http, body),\n me: (accessToken) => getMe(http, accessToken),\n },\n users: {\n getProfile: (accessToken) => getUserProfile(http, accessToken),\n getAgenda: (accessToken, days) => getUserAgenda(http, accessToken, days),\n getTip: (accessToken) => getUserTip(http, accessToken),\n patchProfile: (accessToken, body) => patchUserProfile(http, accessToken, body),\n getPets: (accessToken, userId) => getUserPets(http, accessToken, userId),\n createPet: (accessToken, userId, body) => createUserPet(http, accessToken, userId, body),\n },\n pets: {\n getById: (accessToken, petId) => getPetDetails(http, accessToken, petId),\n update: (accessToken, petId, body) => putPetDetails(http, accessToken, petId, body),\n getTreatments: (accessToken, petId) => getPetTreatments(http, accessToken, petId),\n createTreatment: (accessToken, petId, body) =>\n createPetTreatment(http, accessToken, petId, body),\n getTreatment: (accessToken, petId, treatmentId) =>\n getPetTreatment(http, accessToken, petId, treatmentId),\n patchTreatmentStatus: (accessToken, petId, treatmentId, body) =>\n patchPetTreatmentStatus(http, accessToken, petId, treatmentId, body),\n getTreatmentDoses: (accessToken, petId, treatmentId) =>\n getPetTreatmentDoses(http, accessToken, petId, treatmentId),\n createTreatmentDose: (accessToken, petId, treatmentId, body) =>\n createPetTreatmentDose(http, accessToken, petId, treatmentId, body),\n getAppointments: (accessToken, petId) => getPetAppointments(http, accessToken, petId),\n createAppointment: (accessToken, petId, body) =>\n createPetAppointment(http, accessToken, petId, body),\n getAppointment: (accessToken, petId, appointmentId) =>\n getPetAppointment(http, accessToken, petId, appointmentId),\n patchAppointment: (accessToken, petId, appointmentId, body) =>\n patchPetAppointment(http, accessToken, petId, appointmentId, body),\n patchAppointmentStatus: (accessToken, petId, appointmentId, body) =>\n patchPetAppointmentStatus(http, accessToken, petId, appointmentId, body),\n deleteAppointment: (accessToken, petId, appointmentId) =>\n deletePetAppointment(http, accessToken, petId, appointmentId),\n },\n };\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -98,6 +98,16 @@ async function getPetTreatment(http, accessToken, petId, treatmentId) {
|
|
|
98
98
|
);
|
|
99
99
|
return data;
|
|
100
100
|
}
|
|
101
|
+
async function patchPetTreatmentStatus(http, accessToken, petId, treatmentId, body) {
|
|
102
|
+
const { data } = await http.patch(
|
|
103
|
+
`${PETS_BASE}/${petId}/treatments/${treatmentId}/status`,
|
|
104
|
+
body,
|
|
105
|
+
{
|
|
106
|
+
headers: { Authorization: `Bearer ${accessToken}` }
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
return data;
|
|
110
|
+
}
|
|
101
111
|
async function getPetTreatmentDoses(http, accessToken, petId, treatmentId) {
|
|
102
112
|
const { data } = await http.get(
|
|
103
113
|
`${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,
|
|
@@ -247,6 +257,7 @@ function createApiClient(options) {
|
|
|
247
257
|
getTreatments: (accessToken, petId) => getPetTreatments(http, accessToken, petId),
|
|
248
258
|
createTreatment: (accessToken, petId, body) => createPetTreatment(http, accessToken, petId, body),
|
|
249
259
|
getTreatment: (accessToken, petId, treatmentId) => getPetTreatment(http, accessToken, petId, treatmentId),
|
|
260
|
+
patchTreatmentStatus: (accessToken, petId, treatmentId, body) => patchPetTreatmentStatus(http, accessToken, petId, treatmentId, body),
|
|
250
261
|
getTreatmentDoses: (accessToken, petId, treatmentId) => getPetTreatmentDoses(http, accessToken, petId, treatmentId),
|
|
251
262
|
createTreatmentDose: (accessToken, petId, treatmentId, body) => createPetTreatmentDose(http, accessToken, petId, treatmentId, body),
|
|
252
263
|
getAppointments: (accessToken, petId) => getPetAppointments(http, accessToken, petId),
|
|
@@ -259,6 +270,6 @@ function createApiClient(options) {
|
|
|
259
270
|
};
|
|
260
271
|
}
|
|
261
272
|
|
|
262
|
-
export { createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, getUserTip, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
|
|
273
|
+
export { createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, getUserTip, patchPetAppointment, patchPetAppointmentStatus, patchPetTreatmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
|
|
263
274
|
//# sourceMappingURL=index.mjs.map
|
|
264
275
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/endpoints/auth.ts","../src/endpoints/pet.ts","../src/endpoints/user.ts","../src/endpoints/health-check.ts","../src/create-api-client.ts"],"names":[],"mappings":";AAeA,IAAM,SAAA,GAAY,cAAA;AAKlB,eAAsB,YAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,SAAA,CAAA;AAAA,IACZ;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT;AAKA,eAAsB,SAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,MAAA,CAAA;AAAA,IACZ;AAAA,GACF;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se,\n AuthUserResponse,\n IApiResponse,\n LoginRequest,\n LogoutRequest,\n OAuthGoogleCallbackRequest,\n OAuthGoogleStartResponse,\n RefreshRequest,\n RegisterRequest,\n VerifyEmailRequest,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst AUTH_BASE = '/api/v1/auth' as const;\n\n/**\n * POST /api/v1/auth/register\n */\nexport async function postRegister(\n http: HttpClient,\n body: RegisterRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RegisterRequest>(\n `${AUTH_BASE}/register`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/login\n */\nexport async function postLogin(\n http: HttpClient,\n body: LoginRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, LoginRequest>(\n `${AUTH_BASE}/login`,\n body,\n );\n return data;\n}\n\n/**\n * GET /api/v1/auth/oauth/google/start?redirectUri=...\n */\nexport async function getGoogleOAuthStart(\n http: HttpClient,\n redirectUri: string,\n): Promise<IApiResponse<OAuthGoogleStartResponse>> {\n const q = new URLSearchParams({ redirectUri });\n const { data } = await http.get<IApiResponse<OAuthGoogleStartResponse>>(\n `${AUTH_BASE}/oauth/google/start?${q.toString()}`,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/oauth/google/callback\n */\nexport async function postGoogleOAuthCallback(\n http: HttpClient,\n body: OAuthGoogleCallbackRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, OAuthGoogleCallbackRequest>(\n `${AUTH_BASE}/oauth/google/callback`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/refresh\n */\nexport async function postRefresh(\n http: HttpClient,\n body: RefreshRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RefreshRequest>(\n `${AUTH_BASE}/refresh`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/logout — 204 No Content (no JSON body).\n */\nexport async function postLogout(http: HttpClient, body: LogoutRequest): Promise<void> {\n await http.post<undefined, LogoutRequest>(`${AUTH_BASE}/logout`, body);\n}\n\n/**\n * GET /api/v1/auth/me — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getMe(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<AuthUserResponse>> {\n const { data } = await http.get<IApiResponse<AuthUserResponse>>(`${AUTH_BASE}/me`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/auth/verify-email\n */\nexport async function patchVerifyEmail(\n http: HttpClient,\n body: VerifyEmailRequest,\n): Promise<IApiResponse<void>> {\n const { data } = await http.patch<IApiResponse<void>, VerifyEmailRequest>(\n `${AUTH_BASE}/verify-email`,\n body,\n );\n return data;\n}\n","import type {\n AppointmentResponse,\n AppointmentStatus,\n CreateAppointmentInput,\n CreateDoseInput,\n CreatePetInput,\n CreateTreatmentInput,\n DoseResponse,\n IApiResponse,\n PetResponse,\n TreatmentResponse,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst PETS_BASE = '/api/v1/pets' as const;\n\n/** Body for PUT /api/v1/pets/:petId (partial update; excludes server-owned fields). */\nexport type PutPetDetailsBody = Partial<\n Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>\n>;\n\n/**\n * Same fields as creating a treatment without `petId` (provided in the URL). `status` may be omitted\n * (defaults on the server).\n */\nexport type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> &\n Partial<Pick<CreateTreatmentInput, 'status'>>;\n\n/**\n * POST .../treatments/:treatmentId/doses — `treatmentId`, `petId`, and `ownerId` are not sent in JSON.\n */\nexport type PostPetTreatmentDoseBody = Omit<CreateDoseInput, 'treatmentId' | 'petId' | 'ownerId'> &\n Partial<Pick<CreateDoseInput, 'status'>>;\n\n/**\n * Same fields as creating an appointment without `petId` (provided in the URL). `status` may be omitted\n * (defaults to pending on the server).\n */\nexport type PostPetAppointmentRequestBody = Omit<CreateAppointmentInput, 'petId'> &\n Partial<Pick<CreateAppointmentInput, 'status'>>;\n\n/** Partial update for PATCH /api/v1/pets/:petId/appointments/:appointmentId (excludes status). */\nexport type PatchPetAppointmentRequestBody = Partial<\n Omit<CreateAppointmentInput, 'petId' | 'ownerId' | 'status'>\n>;\n\n/** Body for PATCH .../appointments/:appointmentId/status. */\nexport type PatchPetAppointmentStatusBody = {\n status: AppointmentStatus;\n};\n\n/**\n * GET /api/v1/pets/:petId — Bearer access token required.\n */\nexport async function getPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.get<IApiResponse<PetResponse>>(`${PETS_BASE}/${petId}`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PUT /api/v1/pets/:petId — partial update; owner must match JWT user.\n */\nexport async function putPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PutPetDetailsBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.put<IApiResponse<PetResponse>, PutPetDetailsBody>(\n `${PETS_BASE}/${petId}`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments\n */\nexport async function getPetTreatments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<TreatmentResponse[]>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse[]>>(\n `${PETS_BASE}/${petId}/treatments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments — 201 Created (`IApiResponse<TreatmentResponse>` body).\n */\nexport async function createPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetTreatmentRequestBody,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.post<IApiResponse<TreatmentResponse>, PostPetTreatmentRequestBody>(\n `${PETS_BASE}/${petId}/treatments`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId\n */\nexport async function getPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId/doses\n */\nexport async function getPetTreatmentDoses(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<DoseResponse[]>> {\n const { data } = await http.get<IApiResponse<DoseResponse[]>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments/:treatmentId/doses — 201 Created.\n */\nexport async function createPetTreatmentDose(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: PostPetTreatmentDoseBody,\n): Promise<IApiResponse<DoseResponse>> {\n const { data } = await http.post<IApiResponse<DoseResponse>, PostPetTreatmentDoseBody>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments\n */\nexport async function getPetAppointments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<AppointmentResponse[]>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse[]>>(\n `${PETS_BASE}/${petId}/appointments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/appointments — 201 Created.\n */\nexport async function createPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.post<\n IApiResponse<AppointmentResponse>,\n PostPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function getPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId — partial update (not status).\n */\nexport async function patchPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId/status\n */\nexport async function patchPetAppointmentStatus(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentStatusBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentStatusBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}/status`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * DELETE /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function deletePetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<null>> {\n const { data } = await http.delete<IApiResponse<null>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type {\n CreatePetInput,\n IApiResponse,\n PatchUserProfileInput,\n PetResponse,\n TipResponse,\n UserAgendaResponse,\n UserProfileResponse,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst USERS_BASE = '/api/v1/users' as const;\n\n/** Body for POST /users/:userId/pets (`ownerId` / timestamps come from the server). */\nexport type PostUserPetRequestBody = Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>;\n\n/**\n * GET /api/v1/users/me/tip — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserTip(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<TipResponse>> {\n const { data } = await http.get<IApiResponse<TipResponse>>(`${USERS_BASE}/me/tip`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/agenda — requires `Authorization: Bearer <accessToken>`.\n * Optional `days` query (1–30, default 7).\n */\nexport async function getUserAgenda(\n http: HttpClient,\n accessToken: string,\n days?: number,\n): Promise<IApiResponse<UserAgendaResponse>> {\n const { data } = await http.get<IApiResponse<UserAgendaResponse>>(`${USERS_BASE}/me/agenda`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n params: days !== undefined ? { days } : undefined,\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserProfile(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.get<IApiResponse<UserProfileResponse>>(`${USERS_BASE}/me/profile`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserPets(\n http: HttpClient,\n accessToken: string,\n userId: string,\n): Promise<IApiResponse<PetResponse[]>> {\n const { data } = await http.get<IApiResponse<PetResponse[]>>(`${USERS_BASE}/${userId}/pets`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * POST /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function createUserPet(\n http: HttpClient,\n accessToken: string,\n userId: string,\n body: PostUserPetRequestBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.post<IApiResponse<PetResponse>, PostUserPetRequestBody>(\n `${USERS_BASE}/${userId}/pets`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n * Body must not include `avatar` (API rejects unknown keys in strict mode).\n */\nexport async function patchUserProfile(\n http: HttpClient,\n accessToken: string,\n body: PatchUserProfileInput,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.patch<IApiResponse<UserProfileResponse>, PatchUserProfileInput>(\n `${USERS_BASE}/me/profile`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type { IApiResponse, HealthCheck } from '@ipetsadmin/contracts';\nimport type { HttpClient } from '../http-client';\n\n/** Same path as `/api/${v1}/health-check` on the server when `v1` is the string `'v1'`. */\nconst HEALTH_CHECK_PATH = '/api/v1/health-check' as const;\n\n/**\n * GET /api/v1/health-check — server liveness.\n *\n * Returns the full JSON the server sends (`IApiResponse<HealthCheck>`).\n *\n * **Why not `data.data` here?** Adapters like Axios wrap the HTTP body in a property also\n * called `data`. That outer `data` is the entire `res.json(...)` object. The inner\n * `IApiResponse.data` is the `HealthCheck` payload — use `.data` on the **returned** value,\n * e.g. `(await fetchHealthCheck(http)).data`.\n */\nexport async function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>> {\n const { data: body } = await http.get<IApiResponse<HealthCheck>>(HEALTH_CHECK_PATH);\n\n return body;\n}\n","import {\n getGoogleOAuthStart,\n getMe,\n patchVerifyEmail,\n postGoogleOAuthCallback,\n postLogin,\n postLogout,\n postRefresh,\n postRegister,\n} from './endpoints/auth';\nimport {\n createPetAppointment,\n createPetTreatment,\n createPetTreatmentDose,\n deletePetAppointment,\n getPetAppointment,\n getPetAppointments,\n getPetDetails,\n getPetTreatment,\n getPetTreatmentDoses,\n getPetTreatments,\n patchPetAppointment,\n patchPetAppointmentStatus,\n putPetDetails,\n} from './endpoints/pet';\nimport {\n createUserPet,\n getUserAgenda,\n getUserPets,\n getUserProfile,\n getUserTip,\n patchUserProfile,\n} from './endpoints/user';\nimport { fetchHealthCheck } from './endpoints/health-check';\nimport type { HttpClient } from './http-client';\n\nexport interface CreateApiClientOptions {\n /**\n * Preconfigured HTTP client (e.g. Axios instance with `baseURL` set).\n * Paths in this library are relative to that base (e.g. `/api/v1/...`).\n * `get`, `post`, `patch`, `put`, and `delete` are required for all implemented routes.\n */\n readonly http: HttpClient;\n}\n\nexport interface ApiClient {\n readonly healthCheck: () => ReturnType<typeof fetchHealthCheck>;\n readonly auth: {\n readonly register: (\n body: Parameters<typeof postRegister>[1],\n ) => ReturnType<typeof postRegister>;\n readonly login: (body: Parameters<typeof postLogin>[1]) => ReturnType<typeof postLogin>;\n readonly getGoogleOAuthStart: (redirectUri: string) => ReturnType<typeof getGoogleOAuthStart>;\n readonly postGoogleOAuthCallback: (\n body: Parameters<typeof postGoogleOAuthCallback>[1],\n ) => ReturnType<typeof postGoogleOAuthCallback>;\n readonly refresh: (body: Parameters<typeof postRefresh>[1]) => ReturnType<typeof postRefresh>;\n readonly logout: (body: Parameters<typeof postLogout>[1]) => ReturnType<typeof postLogout>;\n readonly verifyEmail: (\n body: Parameters<typeof patchVerifyEmail>[1],\n ) => ReturnType<typeof patchVerifyEmail>;\n readonly me: (accessToken: string) => ReturnType<typeof getMe>;\n };\n readonly users: {\n readonly getProfile: (accessToken: string) => ReturnType<typeof getUserProfile>;\n readonly getAgenda: (accessToken: string, days?: number) => ReturnType<typeof getUserAgenda>;\n readonly getTip: (accessToken: string) => ReturnType<typeof getUserTip>;\n readonly patchProfile: (\n accessToken: string,\n body: Parameters<typeof patchUserProfile>[2],\n ) => ReturnType<typeof patchUserProfile>;\n readonly getPets: (accessToken: string, userId: string) => ReturnType<typeof getUserPets>;\n readonly createPet: (\n accessToken: string,\n userId: string,\n body: Parameters<typeof createUserPet>[3],\n ) => ReturnType<typeof createUserPet>;\n };\n readonly pets: {\n readonly getById: (accessToken: string, petId: string) => ReturnType<typeof getPetDetails>;\n readonly update: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof putPetDetails>[3],\n ) => ReturnType<typeof putPetDetails>;\n readonly getTreatments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetTreatments>;\n readonly createTreatment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetTreatment>[3],\n ) => ReturnType<typeof createPetTreatment>;\n readonly getTreatment: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatment>;\n readonly getTreatmentDoses: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatmentDoses>;\n readonly createTreatmentDose: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: Parameters<typeof createPetTreatmentDose>[4],\n ) => ReturnType<typeof createPetTreatmentDose>;\n readonly getAppointments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetAppointments>;\n readonly createAppointment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetAppointment>[3],\n ) => ReturnType<typeof createPetAppointment>;\n readonly getAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof getPetAppointment>;\n readonly patchAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointment>[4],\n ) => ReturnType<typeof patchPetAppointment>;\n readonly patchAppointmentStatus: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointmentStatus>[4],\n ) => ReturnType<typeof patchPetAppointmentStatus>;\n readonly deleteAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof deletePetAppointment>;\n };\n}\n\n/**\n * Creates a typed API client backed by the provided HTTP implementation.\n */\nexport function createApiClient(options: CreateApiClientOptions): ApiClient {\n const { http } = options;\n\n return {\n healthCheck: () => fetchHealthCheck(http),\n auth: {\n register: (body) => postRegister(http, body),\n login: (body) => postLogin(http, body),\n getGoogleOAuthStart: (redirectUri) => getGoogleOAuthStart(http, redirectUri),\n postGoogleOAuthCallback: (body) => postGoogleOAuthCallback(http, body),\n refresh: (body) => postRefresh(http, body),\n logout: (body) => postLogout(http, body),\n verifyEmail: (body) => patchVerifyEmail(http, body),\n me: (accessToken) => getMe(http, accessToken),\n },\n users: {\n getProfile: (accessToken) => getUserProfile(http, accessToken),\n getAgenda: (accessToken, days) => getUserAgenda(http, accessToken, days),\n getTip: (accessToken) => getUserTip(http, accessToken),\n patchProfile: (accessToken, body) => patchUserProfile(http, accessToken, body),\n getPets: (accessToken, userId) => getUserPets(http, accessToken, userId),\n createPet: (accessToken, userId, body) => createUserPet(http, accessToken, userId, body),\n },\n pets: {\n getById: (accessToken, petId) => getPetDetails(http, accessToken, petId),\n update: (accessToken, petId, body) => putPetDetails(http, accessToken, petId, body),\n getTreatments: (accessToken, petId) => getPetTreatments(http, accessToken, petId),\n createTreatment: (accessToken, petId, body) =>\n createPetTreatment(http, accessToken, petId, body),\n getTreatment: (accessToken, petId, treatmentId) =>\n getPetTreatment(http, accessToken, petId, treatmentId),\n getTreatmentDoses: (accessToken, petId, treatmentId) =>\n getPetTreatmentDoses(http, accessToken, petId, treatmentId),\n createTreatmentDose: (accessToken, petId, treatmentId, body) =>\n createPetTreatmentDose(http, accessToken, petId, treatmentId, body),\n getAppointments: (accessToken, petId) => getPetAppointments(http, accessToken, petId),\n createAppointment: (accessToken, petId, body) =>\n createPetAppointment(http, accessToken, petId, body),\n getAppointment: (accessToken, petId, appointmentId) =>\n getPetAppointment(http, accessToken, petId, appointmentId),\n patchAppointment: (accessToken, petId, appointmentId, body) =>\n patchPetAppointment(http, accessToken, petId, appointmentId, body),\n patchAppointmentStatus: (accessToken, petId, appointmentId, body) =>\n patchPetAppointmentStatus(http, accessToken, petId, appointmentId, body),\n deleteAppointment: (accessToken, petId, appointmentId) =>\n deletePetAppointment(http, accessToken, petId, appointmentId),\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/endpoints/auth.ts","../src/endpoints/pet.ts","../src/endpoints/user.ts","../src/endpoints/health-check.ts","../src/create-api-client.ts"],"names":[],"mappings":";AAeA,IAAM,SAAA,GAAY,cAAA;AAKlB,eAAsB,YAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,SAAA,CAAA;AAAA,IACZ;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT;AAKA,eAAsB,SAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,IAAA;AAAA,IAC1B,GAAG,SAAS,CAAA,MAAA,CAAA;AAAA,IACZ;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT;AAKA,eAAsB,mBAAA,CACpB,MACA,WAAA,EACiD;AACjD,EAAA,MAAM,CAAA,GAAI,IAAI,eAAA,CAAgB,EAAE,aAAa,CAAA;AAC7C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK,GAAA;AAAA,IAC1B,CAAA,EAAG,SAAS,CAAA,oBAAA,EAAuB,CAAA,CAAE,UAAU,CAAA;AAAA,GACjD;AACA,EAAA,OAAO,IAAA;AACT;AAKA,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AA,EAAO,aAAA,EAAe,IAAI,CAAA;AAAA,MACzE,iBAAA,EAAmB,CAAC,WAAA,EAAa,KAAA,EAAO,kBACtC,oBAAA,CAAqB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,aAAa;AAAA;AAChE,GACF;AACF","file":"index.mjs","sourcesContent":["import type {\n AuthSessionResponse,\n AuthUserResponse,\n IApiResponse,\n LoginRequest,\n LogoutRequest,\n OAuthGoogleCallbackRequest,\n OAuthGoogleStartResponse,\n RefreshRequest,\n RegisterRequest,\n VerifyEmailRequest,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst AUTH_BASE = '/api/v1/auth' as const;\n\n/**\n * POST /api/v1/auth/register\n */\nexport async function postRegister(\n http: HttpClient,\n body: RegisterRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RegisterRequest>(\n `${AUTH_BASE}/register`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/login\n */\nexport async function postLogin(\n http: HttpClient,\n body: LoginRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, LoginRequest>(\n `${AUTH_BASE}/login`,\n body,\n );\n return data;\n}\n\n/**\n * GET /api/v1/auth/oauth/google/start?redirectUri=...\n */\nexport async function getGoogleOAuthStart(\n http: HttpClient,\n redirectUri: string,\n): Promise<IApiResponse<OAuthGoogleStartResponse>> {\n const q = new URLSearchParams({ redirectUri });\n const { data } = await http.get<IApiResponse<OAuthGoogleStartResponse>>(\n `${AUTH_BASE}/oauth/google/start?${q.toString()}`,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/oauth/google/callback\n */\nexport async function postGoogleOAuthCallback(\n http: HttpClient,\n body: OAuthGoogleCallbackRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, OAuthGoogleCallbackRequest>(\n `${AUTH_BASE}/oauth/google/callback`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/refresh\n */\nexport async function postRefresh(\n http: HttpClient,\n body: RefreshRequest,\n): Promise<IApiResponse<AuthSessionResponse>> {\n const { data } = await http.post<IApiResponse<AuthSessionResponse>, RefreshRequest>(\n `${AUTH_BASE}/refresh`,\n body,\n );\n return data;\n}\n\n/**\n * POST /api/v1/auth/logout — 204 No Content (no JSON body).\n */\nexport async function postLogout(http: HttpClient, body: LogoutRequest): Promise<void> {\n await http.post<undefined, LogoutRequest>(`${AUTH_BASE}/logout`, body);\n}\n\n/**\n * GET /api/v1/auth/me — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getMe(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<AuthUserResponse>> {\n const { data } = await http.get<IApiResponse<AuthUserResponse>>(`${AUTH_BASE}/me`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/auth/verify-email\n */\nexport async function patchVerifyEmail(\n http: HttpClient,\n body: VerifyEmailRequest,\n): Promise<IApiResponse<void>> {\n const { data } = await http.patch<IApiResponse<void>, VerifyEmailRequest>(\n `${AUTH_BASE}/verify-email`,\n body,\n );\n return data;\n}\n","import type {\n AppointmentResponse,\n AppointmentStatus,\n CreateAppointmentInput,\n CreateDoseInput,\n CreatePetInput,\n CreateTreatmentInput,\n DoseResponse,\n IApiResponse,\n PetResponse,\n TreatmentResponse,\n TreatmentStatus,\n VaccinationCompletionInput,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst PETS_BASE = '/api/v1/pets' as const;\n\n/** Body for PUT /api/v1/pets/:petId (partial update; excludes server-owned fields). */\nexport type PutPetDetailsBody = Partial<\n Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>\n>;\n\n/**\n * Same fields as creating a treatment without `petId` (provided in the URL). `status` may be omitted\n * (defaults on the server).\n */\nexport type PostPetTreatmentRequestBody = Omit<CreateTreatmentInput, 'petId'> &\n Partial<Pick<CreateTreatmentInput, 'status'>> & {\n vaccinationDetails?: VaccinationCompletionInput;\n };\n\n/** Body for PATCH .../treatments/:treatmentId/status. */\nexport type PatchPetTreatmentStatusBody = {\n status: TreatmentStatus;\n vaccinationDetails?: VaccinationCompletionInput;\n};\n\n/**\n * POST .../treatments/:treatmentId/doses — `treatmentId`, `petId`, and `ownerId` are not sent in JSON.\n */\nexport type PostPetTreatmentDoseBody = Omit<CreateDoseInput, 'treatmentId' | 'petId' | 'ownerId'> &\n Partial<Pick<CreateDoseInput, 'status'>>;\n\n/**\n * Same fields as creating an appointment without `petId` (provided in the URL). `status` may be omitted\n * (defaults to pending on the server).\n */\nexport type PostPetAppointmentRequestBody = Omit<CreateAppointmentInput, 'petId'> &\n Partial<Pick<CreateAppointmentInput, 'status'>>;\n\n/** Partial update for PATCH /api/v1/pets/:petId/appointments/:appointmentId (excludes status). */\nexport type PatchPetAppointmentRequestBody = Partial<\n Omit<CreateAppointmentInput, 'petId' | 'ownerId' | 'status'>\n>;\n\n/** Body for PATCH .../appointments/:appointmentId/status. */\nexport type PatchPetAppointmentStatusBody = {\n status: AppointmentStatus;\n};\n\n/**\n * GET /api/v1/pets/:petId — Bearer access token required.\n */\nexport async function getPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.get<IApiResponse<PetResponse>>(`${PETS_BASE}/${petId}`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PUT /api/v1/pets/:petId — partial update; owner must match JWT user.\n */\nexport async function putPetDetails(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PutPetDetailsBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.put<IApiResponse<PetResponse>, PutPetDetailsBody>(\n `${PETS_BASE}/${petId}`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments\n */\nexport async function getPetTreatments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<TreatmentResponse[]>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse[]>>(\n `${PETS_BASE}/${petId}/treatments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments — 201 Created (`IApiResponse<TreatmentResponse>` body).\n */\nexport async function createPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetTreatmentRequestBody,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.post<IApiResponse<TreatmentResponse>, PostPetTreatmentRequestBody>(\n `${PETS_BASE}/${petId}/treatments`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId\n */\nexport async function getPetTreatment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.get<IApiResponse<TreatmentResponse>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/treatments/:treatmentId/status\n */\nexport async function patchPetTreatmentStatus(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: PatchPetTreatmentStatusBody,\n): Promise<IApiResponse<TreatmentResponse>> {\n const { data } = await http.patch<IApiResponse<TreatmentResponse>, PatchPetTreatmentStatusBody>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/status`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/treatments/:treatmentId/doses\n */\nexport async function getPetTreatmentDoses(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n): Promise<IApiResponse<DoseResponse[]>> {\n const { data } = await http.get<IApiResponse<DoseResponse[]>>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/treatments/:treatmentId/doses — 201 Created.\n */\nexport async function createPetTreatmentDose(\n http: HttpClient,\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: PostPetTreatmentDoseBody,\n): Promise<IApiResponse<DoseResponse>> {\n const { data } = await http.post<IApiResponse<DoseResponse>, PostPetTreatmentDoseBody>(\n `${PETS_BASE}/${petId}/treatments/${treatmentId}/doses`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments\n */\nexport async function getPetAppointments(\n http: HttpClient,\n accessToken: string,\n petId: string,\n): Promise<IApiResponse<AppointmentResponse[]>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse[]>>(\n `${PETS_BASE}/${petId}/appointments`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * POST /api/v1/pets/:petId/appointments — 201 Created.\n */\nexport async function createPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n body: PostPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.post<\n IApiResponse<AppointmentResponse>,\n PostPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function getPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.get<IApiResponse<AppointmentResponse>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId — partial update (not status).\n */\nexport async function patchPetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentRequestBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentRequestBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * PATCH /api/v1/pets/:petId/appointments/:appointmentId/status\n */\nexport async function patchPetAppointmentStatus(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: PatchPetAppointmentStatusBody,\n): Promise<IApiResponse<AppointmentResponse>> {\n const { data } = await http.patch<\n IApiResponse<AppointmentResponse>,\n PatchPetAppointmentStatusBody\n >(`${PETS_BASE}/${petId}/appointments/${appointmentId}/status`, body, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * DELETE /api/v1/pets/:petId/appointments/:appointmentId\n */\nexport async function deletePetAppointment(\n http: HttpClient,\n accessToken: string,\n petId: string,\n appointmentId: string,\n): Promise<IApiResponse<null>> {\n const { data } = await http.delete<IApiResponse<null>>(\n `${PETS_BASE}/${petId}/appointments/${appointmentId}`,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type {\n CreatePetInput,\n IApiResponse,\n PatchUserProfileInput,\n PetResponse,\n TipResponse,\n UserAgendaResponse,\n UserProfileResponse,\n} from '@ipetsadmin/contracts';\n\nimport type { HttpClient } from '../http-client';\n\nconst USERS_BASE = '/api/v1/users' as const;\n\n/** Body for POST /users/:userId/pets (`ownerId` / timestamps come from the server). */\nexport type PostUserPetRequestBody = Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>;\n\n/**\n * GET /api/v1/users/me/tip — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserTip(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<TipResponse>> {\n const { data } = await http.get<IApiResponse<TipResponse>>(`${USERS_BASE}/me/tip`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/agenda — requires `Authorization: Bearer <accessToken>`.\n * Optional `days` query (1–30, default 7).\n */\nexport async function getUserAgenda(\n http: HttpClient,\n accessToken: string,\n days?: number,\n): Promise<IApiResponse<UserAgendaResponse>> {\n const { data } = await http.get<IApiResponse<UserAgendaResponse>>(`${USERS_BASE}/me/agenda`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n params: days !== undefined ? { days } : undefined,\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserProfile(\n http: HttpClient,\n accessToken: string,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.get<IApiResponse<UserProfileResponse>>(`${USERS_BASE}/me/profile`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * GET /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function getUserPets(\n http: HttpClient,\n accessToken: string,\n userId: string,\n): Promise<IApiResponse<PetResponse[]>> {\n const { data } = await http.get<IApiResponse<PetResponse[]>>(`${USERS_BASE}/${userId}/pets`, {\n headers: { Authorization: `Bearer ${accessToken}` },\n });\n return data;\n}\n\n/**\n * POST /api/v1/users/:userId/pets — requires `Authorization: Bearer <accessToken>`.\n */\nexport async function createUserPet(\n http: HttpClient,\n accessToken: string,\n userId: string,\n body: PostUserPetRequestBody,\n): Promise<IApiResponse<PetResponse>> {\n const { data } = await http.post<IApiResponse<PetResponse>, PostUserPetRequestBody>(\n `${USERS_BASE}/${userId}/pets`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n\n/**\n * PATCH /api/v1/users/me/profile — requires `Authorization: Bearer <accessToken>`.\n * Body must not include `avatar` (API rejects unknown keys in strict mode).\n */\nexport async function patchUserProfile(\n http: HttpClient,\n accessToken: string,\n body: PatchUserProfileInput,\n): Promise<IApiResponse<UserProfileResponse>> {\n const { data } = await http.patch<IApiResponse<UserProfileResponse>, PatchUserProfileInput>(\n `${USERS_BASE}/me/profile`,\n body,\n {\n headers: { Authorization: `Bearer ${accessToken}` },\n },\n );\n return data;\n}\n","import type { IApiResponse, HealthCheck } from '@ipetsadmin/contracts';\nimport type { HttpClient } from '../http-client';\n\n/** Same path as `/api/${v1}/health-check` on the server when `v1` is the string `'v1'`. */\nconst HEALTH_CHECK_PATH = '/api/v1/health-check' as const;\n\n/**\n * GET /api/v1/health-check — server liveness.\n *\n * Returns the full JSON the server sends (`IApiResponse<HealthCheck>`).\n *\n * **Why not `data.data` here?** Adapters like Axios wrap the HTTP body in a property also\n * called `data`. That outer `data` is the entire `res.json(...)` object. The inner\n * `IApiResponse.data` is the `HealthCheck` payload — use `.data` on the **returned** value,\n * e.g. `(await fetchHealthCheck(http)).data`.\n */\nexport async function fetchHealthCheck(http: HttpClient): Promise<IApiResponse<HealthCheck>> {\n const { data: body } = await http.get<IApiResponse<HealthCheck>>(HEALTH_CHECK_PATH);\n\n return body;\n}\n","import {\n getGoogleOAuthStart,\n getMe,\n patchVerifyEmail,\n postGoogleOAuthCallback,\n postLogin,\n postLogout,\n postRefresh,\n postRegister,\n} from './endpoints/auth';\nimport {\n createPetAppointment,\n createPetTreatment,\n createPetTreatmentDose,\n deletePetAppointment,\n getPetAppointment,\n getPetAppointments,\n getPetDetails,\n getPetTreatment,\n getPetTreatmentDoses,\n getPetTreatments,\n patchPetAppointment,\n patchPetAppointmentStatus,\n patchPetTreatmentStatus,\n putPetDetails,\n} from './endpoints/pet';\nimport {\n createUserPet,\n getUserAgenda,\n getUserPets,\n getUserProfile,\n getUserTip,\n patchUserProfile,\n} from './endpoints/user';\nimport { fetchHealthCheck } from './endpoints/health-check';\nimport type { HttpClient } from './http-client';\n\nexport interface CreateApiClientOptions {\n /**\n * Preconfigured HTTP client (e.g. Axios instance with `baseURL` set).\n * Paths in this library are relative to that base (e.g. `/api/v1/...`).\n * `get`, `post`, `patch`, `put`, and `delete` are required for all implemented routes.\n */\n readonly http: HttpClient;\n}\n\nexport interface ApiClient {\n readonly healthCheck: () => ReturnType<typeof fetchHealthCheck>;\n readonly auth: {\n readonly register: (\n body: Parameters<typeof postRegister>[1],\n ) => ReturnType<typeof postRegister>;\n readonly login: (body: Parameters<typeof postLogin>[1]) => ReturnType<typeof postLogin>;\n readonly getGoogleOAuthStart: (redirectUri: string) => ReturnType<typeof getGoogleOAuthStart>;\n readonly postGoogleOAuthCallback: (\n body: Parameters<typeof postGoogleOAuthCallback>[1],\n ) => ReturnType<typeof postGoogleOAuthCallback>;\n readonly refresh: (body: Parameters<typeof postRefresh>[1]) => ReturnType<typeof postRefresh>;\n readonly logout: (body: Parameters<typeof postLogout>[1]) => ReturnType<typeof postLogout>;\n readonly verifyEmail: (\n body: Parameters<typeof patchVerifyEmail>[1],\n ) => ReturnType<typeof patchVerifyEmail>;\n readonly me: (accessToken: string) => ReturnType<typeof getMe>;\n };\n readonly users: {\n readonly getProfile: (accessToken: string) => ReturnType<typeof getUserProfile>;\n readonly getAgenda: (accessToken: string, days?: number) => ReturnType<typeof getUserAgenda>;\n readonly getTip: (accessToken: string) => ReturnType<typeof getUserTip>;\n readonly patchProfile: (\n accessToken: string,\n body: Parameters<typeof patchUserProfile>[2],\n ) => ReturnType<typeof patchUserProfile>;\n readonly getPets: (accessToken: string, userId: string) => ReturnType<typeof getUserPets>;\n readonly createPet: (\n accessToken: string,\n userId: string,\n body: Parameters<typeof createUserPet>[3],\n ) => ReturnType<typeof createUserPet>;\n };\n readonly pets: {\n readonly getById: (accessToken: string, petId: string) => ReturnType<typeof getPetDetails>;\n readonly update: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof putPetDetails>[3],\n ) => ReturnType<typeof putPetDetails>;\n readonly getTreatments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetTreatments>;\n readonly createTreatment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetTreatment>[3],\n ) => ReturnType<typeof createPetTreatment>;\n readonly getTreatment: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatment>;\n readonly patchTreatmentStatus: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: Parameters<typeof patchPetTreatmentStatus>[4],\n ) => ReturnType<typeof patchPetTreatmentStatus>;\n readonly getTreatmentDoses: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n ) => ReturnType<typeof getPetTreatmentDoses>;\n readonly createTreatmentDose: (\n accessToken: string,\n petId: string,\n treatmentId: string,\n body: Parameters<typeof createPetTreatmentDose>[4],\n ) => ReturnType<typeof createPetTreatmentDose>;\n readonly getAppointments: (\n accessToken: string,\n petId: string,\n ) => ReturnType<typeof getPetAppointments>;\n readonly createAppointment: (\n accessToken: string,\n petId: string,\n body: Parameters<typeof createPetAppointment>[3],\n ) => ReturnType<typeof createPetAppointment>;\n readonly getAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof getPetAppointment>;\n readonly patchAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointment>[4],\n ) => ReturnType<typeof patchPetAppointment>;\n readonly patchAppointmentStatus: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n body: Parameters<typeof patchPetAppointmentStatus>[4],\n ) => ReturnType<typeof patchPetAppointmentStatus>;\n readonly deleteAppointment: (\n accessToken: string,\n petId: string,\n appointmentId: string,\n ) => ReturnType<typeof deletePetAppointment>;\n };\n}\n\n/**\n * Creates a typed API client backed by the provided HTTP implementation.\n */\nexport function createApiClient(options: CreateApiClientOptions): ApiClient {\n const { http } = options;\n\n return {\n healthCheck: () => fetchHealthCheck(http),\n auth: {\n register: (body) => postRegister(http, body),\n login: (body) => postLogin(http, body),\n getGoogleOAuthStart: (redirectUri) => getGoogleOAuthStart(http, redirectUri),\n postGoogleOAuthCallback: (body) => postGoogleOAuthCallback(http, body),\n refresh: (body) => postRefresh(http, body),\n logout: (body) => postLogout(http, body),\n verifyEmail: (body) => patchVerifyEmail(http, body),\n me: (accessToken) => getMe(http, accessToken),\n },\n users: {\n getProfile: (accessToken) => getUserProfile(http, accessToken),\n getAgenda: (accessToken, days) => getUserAgenda(http, accessToken, days),\n getTip: (accessToken) => getUserTip(http, accessToken),\n patchProfile: (accessToken, body) => patchUserProfile(http, accessToken, body),\n getPets: (accessToken, userId) => getUserPets(http, accessToken, userId),\n createPet: (accessToken, userId, body) => createUserPet(http, accessToken, userId, body),\n },\n pets: {\n getById: (accessToken, petId) => getPetDetails(http, accessToken, petId),\n update: (accessToken, petId, body) => putPetDetails(http, accessToken, petId, body),\n getTreatments: (accessToken, petId) => getPetTreatments(http, accessToken, petId),\n createTreatment: (accessToken, petId, body) =>\n createPetTreatment(http, accessToken, petId, body),\n getTreatment: (accessToken, petId, treatmentId) =>\n getPetTreatment(http, accessToken, petId, treatmentId),\n patchTreatmentStatus: (accessToken, petId, treatmentId, body) =>\n patchPetTreatmentStatus(http, accessToken, petId, treatmentId, body),\n getTreatmentDoses: (accessToken, petId, treatmentId) =>\n getPetTreatmentDoses(http, accessToken, petId, treatmentId),\n createTreatmentDose: (accessToken, petId, treatmentId, body) =>\n createPetTreatmentDose(http, accessToken, petId, treatmentId, body),\n getAppointments: (accessToken, petId) => getPetAppointments(http, accessToken, petId),\n createAppointment: (accessToken, petId, body) =>\n createPetAppointment(http, accessToken, petId, body),\n getAppointment: (accessToken, petId, appointmentId) =>\n getPetAppointment(http, accessToken, petId, appointmentId),\n patchAppointment: (accessToken, petId, appointmentId, body) =>\n patchPetAppointment(http, accessToken, petId, appointmentId, body),\n patchAppointmentStatus: (accessToken, petId, appointmentId, body) =>\n patchPetAppointmentStatus(http, accessToken, petId, appointmentId, body),\n deleteAppointment: (accessToken, petId, appointmentId) =>\n deletePetAppointment(http, accessToken, petId, appointmentId),\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ipetsadmin/api-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Client used to interact with Truffa project API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"author": "",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ipetsadmin/contracts": "1.
|
|
41
|
+
"@ipetsadmin/contracts": "1.7.0",
|
|
42
42
|
"@eslint/js": "^10.0.1",
|
|
43
43
|
"@types/express": "^5.0.5",
|
|
44
44
|
"@types/node": "^24.10.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"typescript-eslint": "^8.58.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@ipetsadmin/contracts": ">=1.
|
|
55
|
+
"@ipetsadmin/contracts": ">=1.7.0"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|