@ipetsadmin/contracts 1.1.5 → 1.1.6
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 +18 -0
- package/dist/index.d.mts +19 -1
- package/dist/index.d.ts +19 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [1.1.6] - 2026-04-25
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **Email verification**:
|
|
27
|
+
- **`IEmailVerificationTokenRepository`** (with **`EmailVerificationTokenRecord`**: `id`, `userId`, `tokenHash`, `expiresAt`, optional `consumedAt`) — create and consume one-time verify-email tokens.
|
|
28
|
+
- **`IEmailVerificationConfig`**: `frontendUrl`, `tokenExpiresInSeconds` for link generation and token TTL.
|
|
29
|
+
- **`IAuthService`**: **`verifyEmail(token, options?)`** to complete email verification in the auth service (implemented in `api-main`).
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **`IUser`**: add **`role`** (**`UserRole`**), **`isActive`**, and optional **`passwordHash`** (alongside the profile fields from 1.1.4); supports authorization, account state, and persistence round-trips. Auth API responses continue to omit secrets.
|
|
34
|
+
- **`IUserRepository`** file location: **`src/interfaces/repositories/IUserRepository.ts`** (no longer under **`repositories/auth/`**). The package barrel still re-exports the port; update deep imports to the new path if you used `…/repositories/auth/IUserRepository`.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **Package barrel (`src/index.ts`)**: **`UserRole`** is re-exported with **`export { UserRole } from '@/enums/roles'`** instead of **`export *`**, so the enum is a reliable **named export** in the tsup CJS/ESM and `.d.ts` output (avoids "declared locally, but is not exported" for consumers).
|
|
39
|
+
|
|
22
40
|
## [1.1.5] - 2026-04-25
|
|
23
41
|
|
|
24
42
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -251,6 +251,18 @@ interface IOAuthStateRepository {
|
|
|
251
251
|
consume(state: string, options?: RepositoryOperationOptions): Promise<OAuthStateRecord | null>;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
type EmailVerificationTokenRecord = {
|
|
255
|
+
id: string;
|
|
256
|
+
userId: string;
|
|
257
|
+
tokenHash: string;
|
|
258
|
+
expiresAt: string;
|
|
259
|
+
consumedAt?: string;
|
|
260
|
+
};
|
|
261
|
+
interface IEmailVerificationTokenRepository {
|
|
262
|
+
create(userId: string, tokenHash: string, expiresAt: Date, options?: RepositoryOperationOptions): Promise<EmailVerificationTokenRecord>;
|
|
263
|
+
consumeByHash(tokenHash: string, options?: RepositoryOperationOptions): Promise<EmailVerificationTokenRecord | null>;
|
|
264
|
+
}
|
|
265
|
+
|
|
254
266
|
interface IAuthService {
|
|
255
267
|
register(email: string, password: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
256
268
|
loginWithUser(user: IUser, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
@@ -258,6 +270,7 @@ interface IAuthService {
|
|
|
258
270
|
completeGoogleOAuth(code: string, state: string, redirectUri: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
259
271
|
refreshSession(refreshToken: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
260
272
|
logout(refreshToken: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
273
|
+
verifyEmail(token: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
261
274
|
}
|
|
262
275
|
|
|
263
276
|
interface IJwtTokensService {
|
|
@@ -291,6 +304,11 @@ interface IEmailProviderAdapter {
|
|
|
291
304
|
send(input: SendEmailInput): Promise<SendEmailResult>;
|
|
292
305
|
}
|
|
293
306
|
|
|
307
|
+
interface IEmailVerificationConfig {
|
|
308
|
+
frontendUrl: string;
|
|
309
|
+
tokenExpiresInSeconds: number;
|
|
310
|
+
}
|
|
311
|
+
|
|
294
312
|
declare enum Errors {
|
|
295
313
|
NOT_FOUND_ERROR = "NotFoundError",
|
|
296
314
|
BUSINESS_ERROR = "BusinessError",
|
|
@@ -341,4 +359,4 @@ declare class UnauthorizedError extends BaseError {
|
|
|
341
359
|
constructor(message: string, details?: Record<string, unknown>);
|
|
342
360
|
}
|
|
343
361
|
|
|
344
|
-
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, type CreateUserInput, type EmailAddress, EmailProvider, Errors, ForbiddenError, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IRefreshTokenRepository, type IServerInit, type IUser, type IUserRepository, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, type TokenPair, UnauthorizedError, UserRole };
|
|
362
|
+
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, type CreateUserInput, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IRefreshTokenRepository, type IServerInit, type IUser, type IUserRepository, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, type TokenPair, UnauthorizedError, UserRole };
|
package/dist/index.d.ts
CHANGED
|
@@ -251,6 +251,18 @@ interface IOAuthStateRepository {
|
|
|
251
251
|
consume(state: string, options?: RepositoryOperationOptions): Promise<OAuthStateRecord | null>;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
type EmailVerificationTokenRecord = {
|
|
255
|
+
id: string;
|
|
256
|
+
userId: string;
|
|
257
|
+
tokenHash: string;
|
|
258
|
+
expiresAt: string;
|
|
259
|
+
consumedAt?: string;
|
|
260
|
+
};
|
|
261
|
+
interface IEmailVerificationTokenRepository {
|
|
262
|
+
create(userId: string, tokenHash: string, expiresAt: Date, options?: RepositoryOperationOptions): Promise<EmailVerificationTokenRecord>;
|
|
263
|
+
consumeByHash(tokenHash: string, options?: RepositoryOperationOptions): Promise<EmailVerificationTokenRecord | null>;
|
|
264
|
+
}
|
|
265
|
+
|
|
254
266
|
interface IAuthService {
|
|
255
267
|
register(email: string, password: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
256
268
|
loginWithUser(user: IUser, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
@@ -258,6 +270,7 @@ interface IAuthService {
|
|
|
258
270
|
completeGoogleOAuth(code: string, state: string, redirectUri: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
259
271
|
refreshSession(refreshToken: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
260
272
|
logout(refreshToken: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
273
|
+
verifyEmail(token: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
261
274
|
}
|
|
262
275
|
|
|
263
276
|
interface IJwtTokensService {
|
|
@@ -291,6 +304,11 @@ interface IEmailProviderAdapter {
|
|
|
291
304
|
send(input: SendEmailInput): Promise<SendEmailResult>;
|
|
292
305
|
}
|
|
293
306
|
|
|
307
|
+
interface IEmailVerificationConfig {
|
|
308
|
+
frontendUrl: string;
|
|
309
|
+
tokenExpiresInSeconds: number;
|
|
310
|
+
}
|
|
311
|
+
|
|
294
312
|
declare enum Errors {
|
|
295
313
|
NOT_FOUND_ERROR = "NotFoundError",
|
|
296
314
|
BUSINESS_ERROR = "BusinessError",
|
|
@@ -341,4 +359,4 @@ declare class UnauthorizedError extends BaseError {
|
|
|
341
359
|
constructor(message: string, details?: Record<string, unknown>);
|
|
342
360
|
}
|
|
343
361
|
|
|
344
|
-
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, type CreateUserInput, type EmailAddress, EmailProvider, Errors, ForbiddenError, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IRefreshTokenRepository, type IServerInit, type IUser, type IUserRepository, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, type TokenPair, UnauthorizedError, UserRole };
|
|
362
|
+
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, type CreateUserInput, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IRefreshTokenRepository, type IServerInit, type IUser, type IUserRepository, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, type TokenPair, UnauthorizedError, UserRole };
|