@ipetsadmin/api-client 1.4.0 → 1.5.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 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.5.0] - 2026-06-12
23
+
24
+ ### Added
25
+
26
+ - **`getUserAgenda`** — `GET /api/v1/users/me/agenda` — optional **`days`** query (1–30); **`IApiResponse<UserAgendaResponse>`**; requires **Bearer** `accessToken`.
27
+ - **`createApiClient`** **`users.getAgenda(accessToken, days?)`**.
28
+ - Re-export **`UserAgendaResponse`** from `@ipetsadmin/contracts` (via response typing).
29
+
30
+ ### Changed
31
+
32
+ - **Peer dependency** on **`@ipetsadmin/contracts`** is now **≥ 1.5.0** (`AgendaItemType`, **`UserAgendaResponse`**, **`IAgendaService`**).
33
+
22
34
  ## [1.4.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, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
1
+ import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, VerifyEmailRequest, AuthUserResponse, PetResponse, CreatePetInput, TreatmentResponse, CreateTreatmentInput, DoseResponse, CreateDoseInput, AppointmentResponse, CreateAppointmentInput, AppointmentStatus, UserProfileResponse, UserAgendaResponse, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
2
2
 
3
3
  type HttpGet = <TResponse>(url: string, config?: unknown) => Promise<{
4
4
  data: TResponse;
@@ -55,6 +55,7 @@ declare function patchPetAppointmentStatus(http: HttpClient, accessToken: string
55
55
  declare function deletePetAppointment(http: HttpClient, accessToken: string, petId: string, appointmentId: string): Promise<IApiResponse<null>>;
56
56
 
57
57
  type PostUserPetRequestBody = Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>;
58
+ declare function getUserAgenda(http: HttpClient, accessToken: string, days?: number): Promise<IApiResponse<UserAgendaResponse>>;
58
59
  declare function getUserProfile(http: HttpClient, accessToken: string): Promise<IApiResponse<UserProfileResponse>>;
59
60
  declare function getUserPets(http: HttpClient, accessToken: string, userId: string): Promise<IApiResponse<PetResponse[]>>;
60
61
  declare function createUserPet(http: HttpClient, accessToken: string, userId: string, body: PostUserPetRequestBody): Promise<IApiResponse<PetResponse>>;
@@ -79,6 +80,7 @@ interface ApiClient {
79
80
  };
80
81
  readonly users: {
81
82
  readonly getProfile: (accessToken: string) => ReturnType<typeof getUserProfile>;
83
+ readonly getAgenda: (accessToken: string, days?: number) => ReturnType<typeof getUserAgenda>;
82
84
  readonly patchProfile: (accessToken: string, body: Parameters<typeof patchUserProfile>[2]) => ReturnType<typeof patchUserProfile>;
83
85
  readonly getPets: (accessToken: string, userId: string) => ReturnType<typeof getUserPets>;
84
86
  readonly createPet: (accessToken: string, userId: string, body: Parameters<typeof createUserPet>[3]) => ReturnType<typeof createUserPet>;
@@ -101,4 +103,4 @@ interface ApiClient {
101
103
  }
102
104
  declare function createApiClient(options: CreateApiClientOptions): ApiClient;
103
105
 
104
- 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, getUserPets, getUserProfile, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
106
+ 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, patchPetAppointment, patchPetAppointmentStatus, 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, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
1
+ import { RegisterRequest, IApiResponse, AuthSessionResponse, LoginRequest, OAuthGoogleStartResponse, OAuthGoogleCallbackRequest, RefreshRequest, LogoutRequest, VerifyEmailRequest, AuthUserResponse, PetResponse, CreatePetInput, TreatmentResponse, CreateTreatmentInput, DoseResponse, CreateDoseInput, AppointmentResponse, CreateAppointmentInput, AppointmentStatus, UserProfileResponse, UserAgendaResponse, PatchUserProfileInput, HealthCheck } from '@ipetsadmin/contracts';
2
2
 
3
3
  type HttpGet = <TResponse>(url: string, config?: unknown) => Promise<{
4
4
  data: TResponse;
@@ -55,6 +55,7 @@ declare function patchPetAppointmentStatus(http: HttpClient, accessToken: string
55
55
  declare function deletePetAppointment(http: HttpClient, accessToken: string, petId: string, appointmentId: string): Promise<IApiResponse<null>>;
56
56
 
57
57
  type PostUserPetRequestBody = Omit<CreatePetInput, 'ownerId' | 'createdAt' | 'updatedAt'>;
58
+ declare function getUserAgenda(http: HttpClient, accessToken: string, days?: number): Promise<IApiResponse<UserAgendaResponse>>;
58
59
  declare function getUserProfile(http: HttpClient, accessToken: string): Promise<IApiResponse<UserProfileResponse>>;
59
60
  declare function getUserPets(http: HttpClient, accessToken: string, userId: string): Promise<IApiResponse<PetResponse[]>>;
60
61
  declare function createUserPet(http: HttpClient, accessToken: string, userId: string, body: PostUserPetRequestBody): Promise<IApiResponse<PetResponse>>;
@@ -79,6 +80,7 @@ interface ApiClient {
79
80
  };
80
81
  readonly users: {
81
82
  readonly getProfile: (accessToken: string) => ReturnType<typeof getUserProfile>;
83
+ readonly getAgenda: (accessToken: string, days?: number) => ReturnType<typeof getUserAgenda>;
82
84
  readonly patchProfile: (accessToken: string, body: Parameters<typeof patchUserProfile>[2]) => ReturnType<typeof patchUserProfile>;
83
85
  readonly getPets: (accessToken: string, userId: string) => ReturnType<typeof getUserPets>;
84
86
  readonly createPet: (accessToken: string, userId: string, body: Parameters<typeof createUserPet>[3]) => ReturnType<typeof createUserPet>;
@@ -101,4 +103,4 @@ interface ApiClient {
101
103
  }
102
104
  declare function createApiClient(options: CreateApiClientOptions): ApiClient;
103
105
 
104
- 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, getUserPets, getUserProfile, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
106
+ 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, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
package/dist/index.js CHANGED
@@ -167,6 +167,13 @@ async function deletePetAppointment(http, accessToken, petId, appointmentId) {
167
167
 
168
168
  // src/endpoints/user.ts
169
169
  var USERS_BASE = "/api/v1/users";
170
+ async function getUserAgenda(http, accessToken, days) {
171
+ const { data } = await http.get(`${USERS_BASE}/me/agenda`, {
172
+ headers: { Authorization: `Bearer ${accessToken}` },
173
+ params: days !== void 0 ? { days } : void 0
174
+ });
175
+ return data;
176
+ }
170
177
  async function getUserProfile(http, accessToken) {
171
178
  const { data } = await http.get(`${USERS_BASE}/me/profile`, {
172
179
  headers: { Authorization: `Bearer ${accessToken}` }
@@ -224,6 +231,7 @@ function createApiClient(options) {
224
231
  },
225
232
  users: {
226
233
  getProfile: (accessToken) => getUserProfile(http, accessToken),
234
+ getAgenda: (accessToken, days) => getUserAgenda(http, accessToken, days),
227
235
  patchProfile: (accessToken, body) => patchUserProfile(http, accessToken, body),
228
236
  getPets: (accessToken, userId) => getUserPets(http, accessToken, userId),
229
237
  createPet: (accessToken, userId, body) => createUserPet(http, accessToken, userId, body)
@@ -261,6 +269,7 @@ exports.getPetDetails = getPetDetails;
261
269
  exports.getPetTreatment = getPetTreatment;
262
270
  exports.getPetTreatmentDoses = getPetTreatmentDoses;
263
271
  exports.getPetTreatments = getPetTreatments;
272
+ exports.getUserAgenda = getUserAgenda;
264
273
  exports.getUserPets = getUserPets;
265
274
  exports.getUserProfile = getUserProfile;
266
275
  exports.patchPetAppointment = patchPetAppointment;
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,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,MAA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,EAAO,aAAA,EAAe,IAAA,KAC1D,yBAAA,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} 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 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/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 { createUserPet, getUserPets, getUserProfile, patchUserProfile } 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 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 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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A,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} 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 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/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 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 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 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"]}
package/dist/index.mjs CHANGED
@@ -165,6 +165,13 @@ async function deletePetAppointment(http, accessToken, petId, appointmentId) {
165
165
 
166
166
  // src/endpoints/user.ts
167
167
  var USERS_BASE = "/api/v1/users";
168
+ async function getUserAgenda(http, accessToken, days) {
169
+ const { data } = await http.get(`${USERS_BASE}/me/agenda`, {
170
+ headers: { Authorization: `Bearer ${accessToken}` },
171
+ params: days !== void 0 ? { days } : void 0
172
+ });
173
+ return data;
174
+ }
168
175
  async function getUserProfile(http, accessToken) {
169
176
  const { data } = await http.get(`${USERS_BASE}/me/profile`, {
170
177
  headers: { Authorization: `Bearer ${accessToken}` }
@@ -222,6 +229,7 @@ function createApiClient(options) {
222
229
  },
223
230
  users: {
224
231
  getProfile: (accessToken) => getUserProfile(http, accessToken),
232
+ getAgenda: (accessToken, days) => getUserAgenda(http, accessToken, days),
225
233
  patchProfile: (accessToken, body) => patchUserProfile(http, accessToken, body),
226
234
  getPets: (accessToken, userId) => getUserPets(http, accessToken, userId),
227
235
  createPet: (accessToken, userId, body) => createUserPet(http, accessToken, userId, body)
@@ -244,6 +252,6 @@ function createApiClient(options) {
244
252
  };
245
253
  }
246
254
 
247
- export { createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserPets, getUserProfile, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
255
+ export { createApiClient, createPetAppointment, createPetTreatment, createPetTreatmentDose, createUserPet, deletePetAppointment, fetchHealthCheck, getGoogleOAuthStart, getMe, getPetAppointment, getPetAppointments, getPetDetails, getPetTreatment, getPetTreatmentDoses, getPetTreatments, getUserAgenda, getUserPets, getUserProfile, patchPetAppointment, patchPetAppointmentStatus, patchUserProfile, patchVerifyEmail, postGoogleOAuthCallback, postLogin, postLogout, postRefresh, postRegister, putPetDetails };
248
256
  //# sourceMappingURL=index.mjs.map
249
257
  //# sourceMappingURL=index.mjs.map
@@ -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;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,eAAsB,uBAAA,CACpB,MACA,IAAA,EAC4C;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,IAAA,CAAK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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 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/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 { createUserPet, getUserPets, getUserProfile, patchUserProfile } 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 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 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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a,KAAA,EAAO,gBACtC,oBAAA,CAAqB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,WAAW,CAAA;AAAA,MAC5D,mBAAA,EAAqB,CAAC,WAAA,EAAa,KAAA,EAAO,WAAA,EAAa,IAAA,KACrD,sBAAA,CAAuB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,WAAA,EAAa,IAAI,CAAA;AAAA,MACpE,iBAAiB,CAAC,WAAA,EAAa,UAAU,kBAAA,CAAmB,IAAA,EAAM,aAAa,KAAK,CAAA;AAAA,MACpF,iBAAA,EAAmB,CAAC,WAAA,EAAa,KAAA,EAAO,SACtC,oBAAA,CAAqB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,IAAI,CAAA;AAAA,MACrD,cAAA,EAAgB,CAAC,WAAA,EAAa,KAAA,EAAO,kBACnC,iBAAA,CAAkB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,aAAa,CAAA;AAAA,MAC3D,gBAAA,EAAkB,CAAC,WAAA,EAAa,KAAA,EAAO,aAAA,EAAe,IAAA,KACpD,mBAAA,CAAoB,IAAA,EAAM,WAAA,EAAa,KAAA,EAAO,aAAA,EAAe,IAAI,CAAA;AAAA,MACnE,sBAAA,EAAwB,CAAC,WAAA,EAAa,KAAA,EAAO,aAAA,EAAe,IAAA,KAC1D,yBAAA,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.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} 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 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/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 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 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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ipetsadmin/api-client",
3
- "version": "1.4.0",
3
+ "version": "1.5.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.4.0",
41
+ "@ipetsadmin/contracts": "1.5.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.4.0"
55
+ "@ipetsadmin/contracts": ">=1.5.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"