@ipetsadmin/contracts 1.1.7 → 1.1.9

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,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
19
 
20
20
  ### Security
21
21
 
22
+ ## [1.1.9] - 2026-04-25
23
+
24
+ ### Added
25
+
26
+ - **`UserProfileResponse`**: id, account fields, and `profile` for the user profile API (no secrets).
27
+ - **`PatchUserProfileInput`**: partial profile update; **`avatar`** is intentionally excluded (separate upload flow).
28
+ - **`IUserService`**: `getProfileForUserId`, `patchProfileForUserId` (optional `RepositoryOperationOptions`).
29
+
30
+ ## [1.1.8] - 2026-04-25
31
+
32
+ ### Added
33
+
34
+ - **`Auth0UserProfile`**: optional OIDC fields from Auth0 **`/userinfo`** (`name`, `given_name`, `family_name`, `picture`, `nickname`, `locale`) for Google / social flows.
35
+ - **`CreateUserInput`**: optional **`profile`** (`IUser['profile']`) for persisting IdP profile on OAuth sign-up.
36
+
37
+ ### Changed
38
+
39
+ - **`IUserRepository.update`**: **`patch`** may include **`profile`** (e.g. admin or in-app profile edits; not used for OAuth re-login profile sync in `api-main` by default).
40
+
22
41
  ## [1.1.7] - 2026-04-25
23
42
 
24
43
  ## Added
package/dist/index.d.mts CHANGED
@@ -116,12 +116,19 @@ type CreateUserInput = {
116
116
  readonly provider: OAuthProvider;
117
117
  readonly providerSubject: string;
118
118
  };
119
+ readonly profile?: IUser['profile'];
119
120
  };
120
121
 
121
122
  type Auth0UserProfile = {
122
123
  readonly sub: string;
123
124
  readonly email?: string;
124
125
  readonly email_verified?: boolean;
126
+ readonly name?: string;
127
+ readonly given_name?: string;
128
+ readonly family_name?: string;
129
+ readonly picture?: string;
130
+ readonly nickname?: string;
131
+ readonly locale?: string;
125
132
  };
126
133
 
127
134
  type Auth0AuthorizationParams = {
@@ -162,6 +169,28 @@ type VerifyEmailRequest = {
162
169
  readonly token: string;
163
170
  };
164
171
 
172
+ type UserProfileResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'role' | 'isActive' | 'profile'>;
173
+
174
+ type PatchUserProfileInput = {
175
+ readonly firstName?: string;
176
+ readonly lastName?: string;
177
+ readonly fullName?: string;
178
+ readonly location?: {
179
+ readonly country?: string;
180
+ readonly city?: string;
181
+ readonly address?: string;
182
+ readonly postalCode?: string;
183
+ };
184
+ readonly phone?: string;
185
+ readonly email?: string;
186
+ readonly website?: string;
187
+ readonly social?: {
188
+ readonly twitter?: string;
189
+ readonly facebook?: string;
190
+ readonly instagram?: string;
191
+ };
192
+ };
193
+
165
194
  interface IConfig {
166
195
  port: number;
167
196
  cors: {
@@ -226,7 +255,7 @@ interface IUserRepository {
226
255
  findById(id: string, options?: RepositoryOperationOptions): Promise<IUser | null>;
227
256
  findByEmail(email: string, options?: RepositoryOperationOptions): Promise<IUser | null>;
228
257
  findByOAuth(provider: OAuthProvider, providerSubject: string, options?: RepositoryOperationOptions): Promise<IUser | null>;
229
- update(id: string, patch: Partial<Pick<IUser, 'email' | 'emailVerified' | 'authMethod' | 'oauth'>> & {
258
+ update(id: string, patch: Partial<Pick<IUser, 'email' | 'emailVerified' | 'authMethod' | 'oauth' | 'profile'>> & {
230
259
  passwordHash?: string | null;
231
260
  }, options?: RepositoryOperationOptions): Promise<void>;
232
261
  }
@@ -313,6 +342,11 @@ interface IEmailVerificationConfig {
313
342
  tokenExpiresInSeconds: number;
314
343
  }
315
344
 
345
+ interface IUserService {
346
+ getProfileForUserId(userId: string, options?: RepositoryOperationOptions): Promise<UserProfileResponse>;
347
+ patchProfileForUserId(userId: string, input: PatchUserProfileInput, options?: RepositoryOperationOptions): Promise<UserProfileResponse>;
348
+ }
349
+
316
350
  declare enum Errors {
317
351
  NOT_FOUND_ERROR = "NotFoundError",
318
352
  BUSINESS_ERROR = "BusinessError",
@@ -363,4 +397,4 @@ declare class UnauthorizedError extends BaseError {
363
397
  constructor(message: string, details?: Record<string, unknown>);
364
398
  }
365
399
 
366
- 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, type VerifyEmailRequest };
400
+ 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 IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, type TokenPair, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest };
package/dist/index.d.ts CHANGED
@@ -116,12 +116,19 @@ type CreateUserInput = {
116
116
  readonly provider: OAuthProvider;
117
117
  readonly providerSubject: string;
118
118
  };
119
+ readonly profile?: IUser['profile'];
119
120
  };
120
121
 
121
122
  type Auth0UserProfile = {
122
123
  readonly sub: string;
123
124
  readonly email?: string;
124
125
  readonly email_verified?: boolean;
126
+ readonly name?: string;
127
+ readonly given_name?: string;
128
+ readonly family_name?: string;
129
+ readonly picture?: string;
130
+ readonly nickname?: string;
131
+ readonly locale?: string;
125
132
  };
126
133
 
127
134
  type Auth0AuthorizationParams = {
@@ -162,6 +169,28 @@ type VerifyEmailRequest = {
162
169
  readonly token: string;
163
170
  };
164
171
 
172
+ type UserProfileResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'role' | 'isActive' | 'profile'>;
173
+
174
+ type PatchUserProfileInput = {
175
+ readonly firstName?: string;
176
+ readonly lastName?: string;
177
+ readonly fullName?: string;
178
+ readonly location?: {
179
+ readonly country?: string;
180
+ readonly city?: string;
181
+ readonly address?: string;
182
+ readonly postalCode?: string;
183
+ };
184
+ readonly phone?: string;
185
+ readonly email?: string;
186
+ readonly website?: string;
187
+ readonly social?: {
188
+ readonly twitter?: string;
189
+ readonly facebook?: string;
190
+ readonly instagram?: string;
191
+ };
192
+ };
193
+
165
194
  interface IConfig {
166
195
  port: number;
167
196
  cors: {
@@ -226,7 +255,7 @@ interface IUserRepository {
226
255
  findById(id: string, options?: RepositoryOperationOptions): Promise<IUser | null>;
227
256
  findByEmail(email: string, options?: RepositoryOperationOptions): Promise<IUser | null>;
228
257
  findByOAuth(provider: OAuthProvider, providerSubject: string, options?: RepositoryOperationOptions): Promise<IUser | null>;
229
- update(id: string, patch: Partial<Pick<IUser, 'email' | 'emailVerified' | 'authMethod' | 'oauth'>> & {
258
+ update(id: string, patch: Partial<Pick<IUser, 'email' | 'emailVerified' | 'authMethod' | 'oauth' | 'profile'>> & {
230
259
  passwordHash?: string | null;
231
260
  }, options?: RepositoryOperationOptions): Promise<void>;
232
261
  }
@@ -313,6 +342,11 @@ interface IEmailVerificationConfig {
313
342
  tokenExpiresInSeconds: number;
314
343
  }
315
344
 
345
+ interface IUserService {
346
+ getProfileForUserId(userId: string, options?: RepositoryOperationOptions): Promise<UserProfileResponse>;
347
+ patchProfileForUserId(userId: string, input: PatchUserProfileInput, options?: RepositoryOperationOptions): Promise<UserProfileResponse>;
348
+ }
349
+
316
350
  declare enum Errors {
317
351
  NOT_FOUND_ERROR = "NotFoundError",
318
352
  BUSINESS_ERROR = "BusinessError",
@@ -363,4 +397,4 @@ declare class UnauthorizedError extends BaseError {
363
397
  constructor(message: string, details?: Record<string, unknown>);
364
398
  }
365
399
 
366
- 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, type VerifyEmailRequest };
400
+ 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 IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, type TokenPair, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ipetsadmin/contracts",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Shared types, enums, and interfaces for Truffa projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",