@ipetsadmin/contracts 1.3.0 → 1.3.2
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 +35 -1
- package/README.md +53 -7
- package/dist/index.d.mts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [1.3.2] - 2026-05-15
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **`WorkerName`** enum (`src/enums/worker-name.ts`): stable BullMQ **`Worker`** `name` values shared by **`@ipetsadmin/api-main`** (currently **`email-notification-worker`**).
|
|
27
|
+
- **`DoseNotificationJobData`** type (`src/types/jobs/DoseNotificationJobData.ts`): payload shape for **`dose-notification`** jobs (producer + worker / clients stay aligned).
|
|
28
|
+
- Barrel exports **`WorkerName`** and **`DoseNotificationJobData`** from **`src/index.ts`**.
|
|
29
|
+
|
|
30
|
+
## [1.3.1] - 2026-05-15
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **Pet model (expanded beyond 1.2.0)**
|
|
35
|
+
- Enums: **`PetStatus`**, **`WeightUnit`**.
|
|
36
|
+
- **`IPet`**: weight, microchip fields, **`allergies`** (**`IAllergy`**), **`vaccines`** (**`IVaccine`**), **`photos`**, **`status`**, timestamps; discriminated union by **`species`** (**`DogBreed`** / **`CatBreed`**).
|
|
37
|
+
- **Pet API contracts**
|
|
38
|
+
- **`IPetService`**: `getPetById`, `getPetsByUserId`, `createPet`, `updatePet` (optional **`RepositoryOperationOptions`**).
|
|
39
|
+
- **`PetResponse`**: type alias for **`IPet`**.
|
|
40
|
+
- **`IPetRepository`**: **`update`** with partial **`CreatePetInput`**.
|
|
41
|
+
- **Treatment domain**
|
|
42
|
+
- Entity **`ITreatment`**; enums **`TreatmentStatus`**, **`TreatmentType`**.
|
|
43
|
+
- **`CreateTreatmentInput`**, **`TreatmentResponse`** (= **`ITreatment`**).
|
|
44
|
+
- **`ITreatmentRepository`**: `create`, `update`, `findById`, `findByPetId`, `delete`.
|
|
45
|
+
- **Dose domain**
|
|
46
|
+
- Entity **`IDose`** (scheduled vs administered dates, **`DoseStatus`**, optional notes).
|
|
47
|
+
- **`CreateDoseInput`**, **`DoseResponse`** (= **`IDose`**).
|
|
48
|
+
- **`IDoseRepository`**: `create`, `findById`, `findByTreatmentId`, `delete`, `deleteByTreatmentId`.
|
|
49
|
+
- **Treatment service**
|
|
50
|
+
- **`ITreatmentService`**: `createTreatment`, `updateTreatment`, `updateTreatmentStatus`, `getTreatmentById` (returns treatment **and nested `doses`**), `getTreatmentsByPetId`, `deleteTreatment`, **`getDosesByTreatmentId`**, **`createDose`**.
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- **CHANGELOG [1.2.0]**: **`CreatePetInput`** lives under **`src/types/pet/CreatePetInput.ts`**, not `src/types/auth/`.
|
|
55
|
+
|
|
22
56
|
## [1.2.0] - 2026-05-12
|
|
23
57
|
|
|
24
58
|
### Added
|
|
@@ -26,7 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
26
60
|
- **Pet domain**:
|
|
27
61
|
- **`IPet`** entity: `name`, **`birthDate`**, **`breed`** (dog or cat), **`species`**, **`gender`**, **`ownerId`**, **`photos`**, and timestamps.
|
|
28
62
|
- **`IPetRepository`** port: `create`, **`findById`**, **`findByOwnerId`** (Mongo implementation in **`api-main`**; adapters can reuse the contract).
|
|
29
|
-
- **`CreatePetInput`**: payload for **`create`** (`src/types/
|
|
63
|
+
- **`CreatePetInput`**: payload for **`create`** (`src/types/pet/CreatePetInput.ts`).
|
|
30
64
|
- **Pet enums** (**`Gender`**, **`Species`**, **`DogBreed`**, **`CatBreed`**) under **`src/enums/`**, used by **`IPet`** and **`CreatePetInput`**.
|
|
31
65
|
|
|
32
66
|
## [1.1.9] - 2026-04-25
|
package/README.md
CHANGED
|
@@ -44,10 +44,10 @@ import {
|
|
|
44
44
|
IServerInit,
|
|
45
45
|
OAuthProvider,
|
|
46
46
|
type AuthSessionResponse,
|
|
47
|
+
type IUser,
|
|
47
48
|
type LoginRequest,
|
|
48
49
|
type RegisterRequest,
|
|
49
50
|
type TokenPair,
|
|
50
|
-
type User,
|
|
51
51
|
BaseError,
|
|
52
52
|
BusinessError,
|
|
53
53
|
ForbiddenError,
|
|
@@ -69,7 +69,7 @@ const health: IApiResponse<HealthCheck> = {
|
|
|
69
69
|
The package defines **shared contracts** for email/password and OAuth (Google via Auth0 on the server), **API-issued JWTs** (access) and **opaque refresh tokens** (server-side storage only—hashes are not part of the public types):
|
|
70
70
|
|
|
71
71
|
- **Enums:** `AuthMethod` (`password` | `oauth`), `OAuthProvider` (e.g. `GOOGLE`, extensible later).
|
|
72
|
-
- **Entities / DTOs:**
|
|
72
|
+
- **Entities / DTOs:** **`IUser`**, `TokenPair`, `AuthUserResponse`, `AuthSessionResponse`, `RegisterRequest`, `LoginRequest`, `RefreshRequest`, `LogoutRequest`, OAuth Google start/callback types, `CreateUserInput`.
|
|
73
73
|
- **Repository ports (implementations live in services):** `IUserRepository`, `IRefreshTokenRepository`, `IOAuthStateRepository` — keep domain types free of MongoDB/Passport imports so SQL or other adapters can implement the same interfaces later.
|
|
74
74
|
- **Service ports** (`interfaces/services/`): `IAuthService`, `IJwtTokensService`, `IAuth0GoogleOAuthService` — implemented by the API’s concrete classes for DI, testing, and clear boundaries.
|
|
75
75
|
- **Auth0/OIDC helpers:** `Auth0UserProfile`, `Auth0AuthorizationParams`, `OAuthAccessTokenResult`.
|
|
@@ -78,6 +78,47 @@ The package defines **shared contracts** for email/password and OAuth (Google vi
|
|
|
78
78
|
|
|
79
79
|
Path aliases (`@/…`) apply only inside this package’s source; consumers import from `@ipetsadmin/contracts` as above.
|
|
80
80
|
|
|
81
|
+
### Pets, treatments, and doses
|
|
82
|
+
|
|
83
|
+
Shared model for veterinary **pets**, **medication/surgery treatments**, and scheduled **doses** (consumers: **`@ipetsadmin/api-main`**, **`@ipetsadmin/api-client`**, etc.):
|
|
84
|
+
|
|
85
|
+
| Area | Highlights |
|
|
86
|
+
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| **Pet** | **`IPet`**: discriminated **`species`** (dog vs cat) with matching **`breed`**, demographics, **`PetStatus`**, **`WeightUnit`**, allergies, vaccines, microchip fields, **`photos`**, timestamps. **`PetResponse`** is an alias for **`IPet`**. **`CreatePetInput`** is used for **`IPetRepository.create`** / **`IPetService`**. **`IPetRepository`**: **`create`**, **`findById`**, **`findByOwnerId`**, **`update`** (partial input). **`IPetService`**: **`getPetById`**, **`getPetsByUserId`**, **`createPet`**, **`updatePet`**. |
|
|
88
|
+
| **Treatment** | **`ITreatment`** (medication line, dosing schedule, **`TreatmentStatus`** / **`TreatmentType`**, optional start/end dates). **`CreateTreatmentInput`**, **`TreatmentResponse`**. **`ITreatmentRepository`**: **`create`**, **`update`**, **`findById`**, **`findByPetId`**, **`delete`**. |
|
|
89
|
+
| **Dose** | **`IDose`** links **`treatmentId`**, **`petId`**, **`ownerId`**; **`doseNumber`**, **`scheduledDate`**, optional **`actualAdministeredDate`**, **`DoseStatus`**, optional **`notes`**. **`CreateDoseInput`**, **`DoseResponse`**. **`IDoseRepository`**: **`create`**, **`findById`**, **`findByTreatmentId`**, **`delete`**, **`deleteByTreatmentId`**. |
|
|
90
|
+
| **Treatment application service** | **`ITreatmentService`**: **`createTreatment`**, **`updateTreatment`**, **`updateTreatmentStatus`**, **`getTreatmentById`** (treatment plus nested **`doses`**), **`getTreatmentsByPetId`**, **`deleteTreatment`**, **`getDosesByTreatmentId`**, **`createDose`**. All methods optionally accept **`RepositoryOperationOptions`** (e.g. Mongo session for transactions). |
|
|
91
|
+
|
|
92
|
+
Related enums (**`Species`**, **`DogBreed`**, **`CatBreed`**, **`Gender`**, **`PetStatus`**, **`WeightUnit`**, **`TreatmentStatus`**, **`TreatmentType`**, **`DoseStatus`**, **`WorkerName`**) live under **`src/enums/`** and are re-exported from the package root.
|
|
93
|
+
|
|
94
|
+
### Background jobs (BullMQ)
|
|
95
|
+
|
|
96
|
+
Queue names remain implementation-specific on the API, but **job payloads** and **`Worker.name`** strings may be shared so producers, consumers, and clients agree on types:
|
|
97
|
+
|
|
98
|
+
| Export | Purpose |
|
|
99
|
+
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
100
|
+
| **`DoseNotificationJobData`** | Data for **`dose-notification`** jobs (`doseId`, `treatmentId`, `petId`, `ownerId`, **`medicationName`**, **`doseNumber`**). |
|
|
101
|
+
| **`WorkerName`** | **`EMAIL_NOTIFICATION_WORKER`** (`email-notification-worker`) — aligns with BullMQ **`Worker`** `name` in **`api-main`**. |
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import {
|
|
105
|
+
type CreatePetInput,
|
|
106
|
+
type CreateTreatmentInput,
|
|
107
|
+
type CreateDoseInput,
|
|
108
|
+
type DoseNotificationJobData,
|
|
109
|
+
type IPet,
|
|
110
|
+
type ITreatment,
|
|
111
|
+
type IDose,
|
|
112
|
+
type IPetService,
|
|
113
|
+
type ITreatmentService,
|
|
114
|
+
WorkerName,
|
|
115
|
+
PetStatus,
|
|
116
|
+
TreatmentType,
|
|
117
|
+
TreatmentStatus,
|
|
118
|
+
DoseStatus,
|
|
119
|
+
} from '@ipetsadmin/contracts';
|
|
120
|
+
```
|
|
121
|
+
|
|
81
122
|
The published package is **dual CJS + ESM** (`exports.require` → `dist/index.js`, `exports.import` → `dist/index.mjs`).
|
|
82
123
|
That way **`import { BaseError, BusinessError } from '@ipetsadmin/contracts'`** works in ESM projects (`"type": "module"`,
|
|
83
124
|
Vite, etc.), and **`require('@ipetsadmin/contracts')`** still works in CommonJS. Use TypeScript
|
|
@@ -126,14 +167,15 @@ pnpm install
|
|
|
126
167
|
|
|
127
168
|
Source lives under `src/`:
|
|
128
169
|
|
|
129
|
-
- `enums/` — shared enums (
|
|
170
|
+
- `enums/` — shared enums (`Errors`, `HealthStatus`, `AuthMethod`, `OAuthProvider`, `Species`, `PetStatus`, `TreatmentStatus`, `TreatmentType`, `DoseStatus`, `WorkerName`, …)
|
|
130
171
|
- `errors/` — error classes (`BaseError`, domain errors, …)
|
|
172
|
+
- `interfaces/entities/` — domain entities (`IUser`, `IPet`, `ITreatment`, `IDose`; nested types such as **`IAllergy`**, **`IVaccine`** on **`IPet`**)
|
|
131
173
|
- `interfaces/general/` — cross-cutting interfaces (`IConfig`, pagination, API responses, server bootstrap types, …)
|
|
132
|
-
- `interfaces/
|
|
133
|
-
- `interfaces/services/` — service ports (`IAuthService`, `IJwtTokensService`, `IAuth0GoogleOAuthService`)
|
|
134
|
-
- `types/` —
|
|
174
|
+
- `interfaces/repositories/` — persistence ports (`IUserRepository`, `IPetRepository`, `ITreatmentRepository`, `IDoseRepository`, …) plus **`repositories/auth/`** for refresh/oauth tokens
|
|
175
|
+
- `interfaces/services/` — application service ports (`IAuthService`, `IJwtTokensService`, `IAuth0GoogleOAuthService`, `IUserService`, `IPetService`, `ITreatmentService`, email subfolder, …)
|
|
176
|
+
- `types/` — DTOs and aliases (`types/auth/`, `types/pet/`, `types/treatment/`, `types/dose/`, `types/jobs/` e.g. **`DoseNotificationJobData`**, `types/user/`, `types/email/`, `HealthCheck`, `RepositoryOperationOptions`, …)
|
|
135
177
|
|
|
136
|
-
The public API is whatever `src/index.ts` re-exports. Additional
|
|
178
|
+
The public API is whatever `src/index.ts` re-exports. Additional definitions under `src/` only appear for consumers when listed there.
|
|
137
179
|
|
|
138
180
|
## Serverless / private registry notes
|
|
139
181
|
|
|
@@ -153,6 +195,10 @@ package:
|
|
|
153
195
|
|
|
154
196
|
Dependencies resolve at build time; ensure registry or Git access is configured for private packages.
|
|
155
197
|
|
|
198
|
+
## Changelog
|
|
199
|
+
|
|
200
|
+
Release notes live in [CHANGELOG.md](./CHANGELOG.md) (Keep a Changelog).
|
|
201
|
+
|
|
156
202
|
## License
|
|
157
203
|
|
|
158
204
|
See [LICENSE](./LICENSE) (MIT).
|
package/dist/index.d.mts
CHANGED
|
@@ -406,6 +406,15 @@ type AuthSessionResponse = TokenPair & {
|
|
|
406
406
|
readonly user: AuthUserResponse;
|
|
407
407
|
};
|
|
408
408
|
|
|
409
|
+
type DoseNotificationJobData = {
|
|
410
|
+
doseId: string;
|
|
411
|
+
treatmentId: string;
|
|
412
|
+
petId: string;
|
|
413
|
+
ownerId: string;
|
|
414
|
+
medicationName: string;
|
|
415
|
+
doseNumber: number;
|
|
416
|
+
};
|
|
417
|
+
|
|
409
418
|
interface IConfig {
|
|
410
419
|
port: number;
|
|
411
420
|
cors: {
|
|
@@ -625,6 +634,17 @@ interface ITreatmentService {
|
|
|
625
634
|
}>;
|
|
626
635
|
getTreatmentsByPetId(petId: string, options?: RepositoryOperationOptions): Promise<ITreatment[]>;
|
|
627
636
|
deleteTreatment(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
637
|
+
getDosesByTreatmentId(params: {
|
|
638
|
+
treatmentId: string;
|
|
639
|
+
petId: string;
|
|
640
|
+
ownerId: string;
|
|
641
|
+
}, options?: RepositoryOperationOptions): Promise<IDose[]>;
|
|
642
|
+
createDose(params: {
|
|
643
|
+
treatmentId: string;
|
|
644
|
+
petId: string;
|
|
645
|
+
ownerId: string;
|
|
646
|
+
input: CreateDoseInput;
|
|
647
|
+
}, options?: RepositoryOperationOptions): Promise<IDose>;
|
|
628
648
|
}
|
|
629
649
|
|
|
630
650
|
declare enum Errors {
|
|
@@ -644,6 +664,10 @@ declare enum Errors {
|
|
|
644
664
|
PAYLOAD_TOO_LARGE_ERROR = "PayloadTooLargeError"
|
|
645
665
|
}
|
|
646
666
|
|
|
667
|
+
declare enum WorkerName {
|
|
668
|
+
EMAIL_NOTIFICATION_WORKER = "email-notification-worker"
|
|
669
|
+
}
|
|
670
|
+
|
|
647
671
|
declare class BaseError extends Error {
|
|
648
672
|
details?: Record<string, unknown>;
|
|
649
673
|
toErrorRecord(): {
|
|
@@ -677,4 +701,4 @@ declare class UnauthorizedError extends BaseError {
|
|
|
677
701
|
constructor(message: string, details?: Record<string, unknown>);
|
|
678
702
|
}
|
|
679
703
|
|
|
680
|
-
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreateDoseInput, type CreatePetInput, type CreateTreatmentInput, type CreateUserInput, DogBreed, type DoseResponse, DoseStatus, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IDose, type IDoseRepository, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type ITreatment, type ITreatmentRepository, type ITreatmentService, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, type TreatmentResponse, TreatmentStatus, TreatmentType, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit };
|
|
704
|
+
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreateDoseInput, type CreatePetInput, type CreateTreatmentInput, type CreateUserInput, DogBreed, type DoseNotificationJobData, type DoseResponse, DoseStatus, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IDose, type IDoseRepository, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type ITreatment, type ITreatmentRepository, type ITreatmentService, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, type TreatmentResponse, TreatmentStatus, TreatmentType, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit, WorkerName };
|
package/dist/index.d.ts
CHANGED
|
@@ -406,6 +406,15 @@ type AuthSessionResponse = TokenPair & {
|
|
|
406
406
|
readonly user: AuthUserResponse;
|
|
407
407
|
};
|
|
408
408
|
|
|
409
|
+
type DoseNotificationJobData = {
|
|
410
|
+
doseId: string;
|
|
411
|
+
treatmentId: string;
|
|
412
|
+
petId: string;
|
|
413
|
+
ownerId: string;
|
|
414
|
+
medicationName: string;
|
|
415
|
+
doseNumber: number;
|
|
416
|
+
};
|
|
417
|
+
|
|
409
418
|
interface IConfig {
|
|
410
419
|
port: number;
|
|
411
420
|
cors: {
|
|
@@ -625,6 +634,17 @@ interface ITreatmentService {
|
|
|
625
634
|
}>;
|
|
626
635
|
getTreatmentsByPetId(petId: string, options?: RepositoryOperationOptions): Promise<ITreatment[]>;
|
|
627
636
|
deleteTreatment(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
637
|
+
getDosesByTreatmentId(params: {
|
|
638
|
+
treatmentId: string;
|
|
639
|
+
petId: string;
|
|
640
|
+
ownerId: string;
|
|
641
|
+
}, options?: RepositoryOperationOptions): Promise<IDose[]>;
|
|
642
|
+
createDose(params: {
|
|
643
|
+
treatmentId: string;
|
|
644
|
+
petId: string;
|
|
645
|
+
ownerId: string;
|
|
646
|
+
input: CreateDoseInput;
|
|
647
|
+
}, options?: RepositoryOperationOptions): Promise<IDose>;
|
|
628
648
|
}
|
|
629
649
|
|
|
630
650
|
declare enum Errors {
|
|
@@ -644,6 +664,10 @@ declare enum Errors {
|
|
|
644
664
|
PAYLOAD_TOO_LARGE_ERROR = "PayloadTooLargeError"
|
|
645
665
|
}
|
|
646
666
|
|
|
667
|
+
declare enum WorkerName {
|
|
668
|
+
EMAIL_NOTIFICATION_WORKER = "email-notification-worker"
|
|
669
|
+
}
|
|
670
|
+
|
|
647
671
|
declare class BaseError extends Error {
|
|
648
672
|
details?: Record<string, unknown>;
|
|
649
673
|
toErrorRecord(): {
|
|
@@ -677,4 +701,4 @@ declare class UnauthorizedError extends BaseError {
|
|
|
677
701
|
constructor(message: string, details?: Record<string, unknown>);
|
|
678
702
|
}
|
|
679
703
|
|
|
680
|
-
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreateDoseInput, type CreatePetInput, type CreateTreatmentInput, type CreateUserInput, DogBreed, type DoseResponse, DoseStatus, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IDose, type IDoseRepository, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type ITreatment, type ITreatmentRepository, type ITreatmentService, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, type TreatmentResponse, TreatmentStatus, TreatmentType, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit };
|
|
704
|
+
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreateDoseInput, type CreatePetInput, type CreateTreatmentInput, type CreateUserInput, DogBreed, type DoseNotificationJobData, type DoseResponse, DoseStatus, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IDose, type IDoseRepository, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type ITreatment, type ITreatmentRepository, type ITreatmentService, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, type TreatmentResponse, TreatmentStatus, TreatmentType, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit, WorkerName };
|
package/dist/index.js
CHANGED
|
@@ -156,6 +156,12 @@ var TreatmentType = /* @__PURE__ */ ((TreatmentType2) => {
|
|
|
156
156
|
return TreatmentType2;
|
|
157
157
|
})(TreatmentType || {});
|
|
158
158
|
|
|
159
|
+
// src/enums/worker-name.ts
|
|
160
|
+
var WorkerName = /* @__PURE__ */ ((WorkerName2) => {
|
|
161
|
+
WorkerName2["EMAIL_NOTIFICATION_WORKER"] = "email-notification-worker";
|
|
162
|
+
return WorkerName2;
|
|
163
|
+
})(WorkerName || {});
|
|
164
|
+
|
|
159
165
|
// src/errors/BaseError.ts
|
|
160
166
|
var BaseError = class extends Error {
|
|
161
167
|
toErrorRecord() {
|
|
@@ -238,5 +244,6 @@ exports.TreatmentType = TreatmentType;
|
|
|
238
244
|
exports.UnauthorizedError = UnauthorizedError;
|
|
239
245
|
exports.UserRole = UserRole;
|
|
240
246
|
exports.WeightUnit = WeightUnit;
|
|
247
|
+
exports.WorkerName = WorkerName;
|
|
241
248
|
//# sourceMappingURL=index.js.map
|
|
242
249
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/enums/treatment-status.ts","../src/enums/dose-status.ts","../src/enums/treatment-type.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit","TreatmentStatus","DoseStatus","TreatmentType"],"mappings":";;;AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAdhB,EAAA,OAAAA,OAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA;;;ACAL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,cAAA,WAAA,CAAA,GAAY,WAAA;AAFF,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;ACAL,IAAK,QAAA,qBAAAC,SAAAA,KAAL;AACL,EAAAA,UAAA,OAAA,CAAA,GAAQ,OAAA;AAC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,CAAO,cAAA,CAAe,IAAA,EAAM,eAAA,CAAe,SAAS,CAAA;AAAA,EACtD;AACF;;;ACRO,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,SAAA,CAAU;AAAA,EAEpC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,eAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,cAAA,CAAc,SAAS,CAAA;AAAA,EACrD;AACF;;;ACRO,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoB,SAAA,CAAU;AAAA,EAElC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,aAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,YAAA,CAAY,SAAS,CAAA;AAAA,EACnD;AACF;;;ACRO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,SAAA,CAAU;AAAA,EAExC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,mBAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF","file":"index.js","sourcesContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export enum TreatmentStatus {\n WAITING_START = 'waiting_start',\n PENDING = 'pending',\n IN_PROGRESS = 'in_progress',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n","export enum DoseStatus {\n PENDING = 'pending',\n ADMINISTERED = 'administered',\n SKIPPED = 'skipped',\n SNOOZED = 'snoozed',\n}\n","export enum TreatmentType {\n MEDICATION = 'medication',\n SURGERY = 'surgery',\n DIAGNOSIS = 'diagnosis',\n DESPARASITIZATION = 'desparasitization',\n VACCINATION = 'vaccination',\n EXAM = 'exam',\n DENTAL = 'dental',\n OTHER = 'other',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/enums/treatment-status.ts","../src/enums/dose-status.ts","../src/enums/treatment-type.ts","../src/enums/worker-name.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit","TreatmentStatus","DoseStatus","TreatmentType","WorkerName"],"mappings":";;;AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAdhB,EAAA,OAAAA,OAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA;;;ACAL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,cAAA,WAAA,CAAA,GAAY,WAAA;AAFF,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;ACAL,IAAK,QAAA,qBAAAC,SAAAA,KAAL;AACL,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esContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export enum TreatmentStatus {\n WAITING_START = 'waiting_start',\n PENDING = 'pending',\n IN_PROGRESS = 'in_progress',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n","export enum DoseStatus {\n PENDING = 'pending',\n ADMINISTERED = 'administered',\n SKIPPED = 'skipped',\n SNOOZED = 'snoozed',\n}\n","export enum TreatmentType {\n MEDICATION = 'medication',\n SURGERY = 'surgery',\n DIAGNOSIS = 'diagnosis',\n DESPARASITIZATION = 'desparasitization',\n VACCINATION = 'vaccination',\n EXAM = 'exam',\n DENTAL = 'dental',\n OTHER = 'other',\n}\n","export enum WorkerName {\n EMAIL_NOTIFICATION_WORKER = 'email-notification-worker',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -154,6 +154,12 @@ var TreatmentType = /* @__PURE__ */ ((TreatmentType2) => {
|
|
|
154
154
|
return TreatmentType2;
|
|
155
155
|
})(TreatmentType || {});
|
|
156
156
|
|
|
157
|
+
// src/enums/worker-name.ts
|
|
158
|
+
var WorkerName = /* @__PURE__ */ ((WorkerName2) => {
|
|
159
|
+
WorkerName2["EMAIL_NOTIFICATION_WORKER"] = "email-notification-worker";
|
|
160
|
+
return WorkerName2;
|
|
161
|
+
})(WorkerName || {});
|
|
162
|
+
|
|
157
163
|
// src/errors/BaseError.ts
|
|
158
164
|
var BaseError = class extends Error {
|
|
159
165
|
toErrorRecord() {
|
|
@@ -215,6 +221,6 @@ var UnauthorizedError = class _UnauthorizedError extends BaseError {
|
|
|
215
221
|
}
|
|
216
222
|
};
|
|
217
223
|
|
|
218
|
-
export { AuthMethod, BaseError, BusinessError, CatBreed, DogBreed, DoseStatus, EmailProvider, Errors, ForbiddenError, Gender, HealthStatus, NotFoundError, OAuthProvider, PetStatus, ServerError, Species, TreatmentStatus, TreatmentType, UnauthorizedError, UserRole, WeightUnit };
|
|
224
|
+
export { AuthMethod, BaseError, BusinessError, CatBreed, DogBreed, DoseStatus, EmailProvider, Errors, ForbiddenError, Gender, HealthStatus, NotFoundError, OAuthProvider, PetStatus, ServerError, Species, TreatmentStatus, TreatmentType, UnauthorizedError, UserRole, WeightUnit, WorkerName };
|
|
219
225
|
//# sourceMappingURL=index.mjs.map
|
|
220
226
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/enums/treatment-status.ts","../src/enums/dose-status.ts","../src/enums/treatment-type.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit","TreatmentStatus","DoseStatus","TreatmentType"],"mappings":";AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAdhB,EAAA,OAAAA,OAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA;;;ACAL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,cAAA,WAAA,CAAA,GAAY,WAAA;AAFF,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;ACAL,IAAK,QAAA,qBAAAC,SAAAA,KAAL;AACL,EAAAA,UAAA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AAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,eAAA,CAAe,SAAS,CAAA;AAAA,EACtD;AACF;;;ACRO,IAAM,aAAA,GAAN,MAAM,cAAA,SAAsB,SAAA,CAAU;AAAA,EAEpC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,eAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,cAAA,CAAc,SAAS,CAAA;AAAA,EACrD;AACF;;;ACRO,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoB,SAAA,CAAU;AAAA,EAElC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,aAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,YAAA,CAAY,SAAS,CAAA;AAAA,EACnD;AACF;;;ACRO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,SAAA,CAAU;AAAA,EAExC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,mBAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF","file":"index.mjs","sourcesContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export enum TreatmentStatus {\n WAITING_START = 'waiting_start',\n PENDING = 'pending',\n IN_PROGRESS = 'in_progress',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n","export enum DoseStatus {\n PENDING = 'pending',\n ADMINISTERED = 'administered',\n SKIPPED = 'skipped',\n SNOOZED = 'snoozed',\n}\n","export enum TreatmentType {\n MEDICATION = 'medication',\n SURGERY = 'surgery',\n DIAGNOSIS = 'diagnosis',\n DESPARASITIZATION = 'desparasitization',\n VACCINATION = 'vaccination',\n EXAM = 'exam',\n DENTAL = 'dental',\n OTHER = 'other',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/enums/treatment-status.ts","../src/enums/dose-status.ts","../src/enums/treatment-type.ts","../src/enums/worker-name.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit","TreatmentStatus","DoseStatus","TreatmentType","WorkerName"],"mappings":";AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAdhB,EAAA,OAAAA,OAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA;;;ACAL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,SAAA,CAAA,GAAU,SAAA;AACV,EAAAA,cAAA,WAAA,CAAA,GAAY,WAAA;AAFF,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;ACAL,IAAK,QAA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AAAA,EACzD;AACF","file":"index.mjs","sourcesContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export enum TreatmentStatus {\n WAITING_START = 'waiting_start',\n PENDING = 'pending',\n IN_PROGRESS = 'in_progress',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n","export enum DoseStatus {\n PENDING = 'pending',\n ADMINISTERED = 'administered',\n SKIPPED = 'skipped',\n SNOOZED = 'snoozed',\n}\n","export enum TreatmentType {\n MEDICATION = 'medication',\n SURGERY = 'surgery',\n DIAGNOSIS = 'diagnosis',\n DESPARASITIZATION = 'desparasitization',\n VACCINATION = 'vaccination',\n EXAM = 'exam',\n DENTAL = 'dental',\n OTHER = 'other',\n}\n","export enum WorkerName {\n EMAIL_NOTIFICATION_WORKER = 'email-notification-worker',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|