@loyal-ix/loyalix-shared-types 1.1.0 → 1.3.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/dist/index.d.mts CHANGED
@@ -65,6 +65,15 @@ declare enum BusinessStatus {
65
65
  SUSPENDED = "suspended"
66
66
  }
67
67
 
68
+ /**
69
+ * OAuth Provider Enum
70
+ * Supported third-party authentication providers
71
+ */
72
+ declare enum OAuthProvider {
73
+ GOOGLE = "google",
74
+ FACEBOOK = "facebook"
75
+ }
76
+
68
77
  interface SuccessResponse<T> {
69
78
  success: true;
70
79
  data: T;
@@ -153,6 +162,84 @@ interface LoginResponseDto {
153
162
  user: LoggedInUserDto;
154
163
  }
155
164
 
165
+ interface VerifyEmailDto {
166
+ token: string;
167
+ }
168
+ interface ResendVerificationDto {
169
+ email: string;
170
+ }
171
+ interface VerificationResponseDto {
172
+ success: boolean;
173
+ message: string;
174
+ }
175
+
176
+ interface ForgotPasswordDto {
177
+ email: string;
178
+ }
179
+ interface ResetPasswordDto {
180
+ token: string;
181
+ newPassword: string;
182
+ }
183
+
184
+ /**
185
+ * OAuth Authentication DTOs
186
+ * Used for third-party authentication (Google, Facebook)
187
+ */
188
+ /**
189
+ * OAuth user data received from provider after authentication
190
+ */
191
+ interface OAuthUserDto {
192
+ /** Email from OAuth provider */
193
+ email: string;
194
+ /** First name from OAuth profile */
195
+ firstName?: string;
196
+ /** Last name from OAuth profile */
197
+ lastName?: string;
198
+ /** OAuth provider name (google, facebook) */
199
+ provider: string;
200
+ /** Unique user ID from the OAuth provider */
201
+ providerId: string;
202
+ /** OAuth access token (optional, for API calls) */
203
+ accessToken?: string;
204
+ /** OAuth refresh token (optional, for token refresh) */
205
+ refreshToken?: string;
206
+ /** Profile photo URL from OAuth provider */
207
+ profilePhoto?: string;
208
+ /** Account type for new registrations */
209
+ accountType?: 'customer' | 'business';
210
+ }
211
+ /**
212
+ * DTO for initiating OAuth flow
213
+ */
214
+ interface OAuthInitiateDto {
215
+ /** Account type - required for new user registration */
216
+ accountType: 'customer' | 'business';
217
+ }
218
+ /**
219
+ * OAuth error response when authentication fails
220
+ */
221
+ interface OAuthErrorResponseDto {
222
+ /** Error code for programmatic handling */
223
+ code: string;
224
+ /** Human-readable error message */
225
+ message: string;
226
+ /** Existing auth method if email conflict (e.g., 'email', 'google', 'facebook') */
227
+ existingAuthMethod?: string;
228
+ }
229
+ /**
230
+ * OAuth callback query parameters
231
+ */
232
+ interface OAuthCallbackQueryDto {
233
+ /** OAuth authorization code */
234
+ code?: string;
235
+ /** State parameter (contains accountType) */
236
+ state?: string;
237
+ /** Error from OAuth provider */
238
+ error?: string;
239
+ /** Error description from OAuth provider */
240
+ error_description?: string;
241
+ }
242
+
156
243
  interface CreateUserDto {
157
244
  email: string;
158
245
  password: string;
@@ -191,6 +278,27 @@ interface UserResponseDto extends UserDto {
191
278
  lastActive?: string;
192
279
  }
193
280
 
281
+ /**
282
+ * Full image DTO with all metadata for detailed views
283
+ */
284
+ interface ImageDto {
285
+ id: string;
286
+ url: string;
287
+ thumbnailUrl?: string;
288
+ width: number;
289
+ height: number;
290
+ mimeType: string;
291
+ dominantColor?: string;
292
+ }
293
+ /**
294
+ * Minimal image reference for list views
295
+ */
296
+ interface ImageRefDto {
297
+ id: string;
298
+ url: string;
299
+ thumbnailUrl?: string;
300
+ }
301
+
194
302
  interface CreateBusinessDto {
195
303
  name: string;
196
304
  email: string;
@@ -234,6 +342,8 @@ interface BusinessListItemDto {
234
342
  industryType?: string;
235
343
  activeProgramCount?: number;
236
344
  totalCustomers?: number;
345
+ profileImage?: ImageRefDto;
346
+ images?: ImageRefDto[];
237
347
  }
238
348
  /**
239
349
  * Detailed business DTO for admin views
@@ -307,9 +417,11 @@ interface LoyaltyProgramDto {
307
417
  id: string;
308
418
  businessId: string;
309
419
  name: string;
420
+ description?: string;
310
421
  isActive: boolean;
311
422
  createdAt: string;
312
423
  updatedAt: string;
424
+ coverImage?: ImageRefDto;
313
425
  }
314
426
 
315
- export { type ApiResponse, type BusinessDetailDto, type BusinessDto, type BusinessListItemDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerAdminResponseDto, type CustomerDto, type CustomerResponseDto, type ErrorDetail, type ErrorResponse, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto, type UserResponseDto };
427
+ export { type ApiResponse, type BusinessDetailDto, type BusinessDto, type BusinessListItemDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerAdminResponseDto, type CustomerDto, type CustomerResponseDto, type ErrorDetail, type ErrorResponse, type ForgotPasswordDto, type ImageDto, type ImageRefDto, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type OAuthCallbackQueryDto, type OAuthErrorResponseDto, type OAuthInitiateDto, OAuthProvider, type OAuthUserDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, type ResendVerificationDto, type ResetPasswordDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto, type UserResponseDto, type VerificationResponseDto, type VerifyEmailDto };
package/dist/index.d.ts CHANGED
@@ -65,6 +65,15 @@ declare enum BusinessStatus {
65
65
  SUSPENDED = "suspended"
66
66
  }
67
67
 
68
+ /**
69
+ * OAuth Provider Enum
70
+ * Supported third-party authentication providers
71
+ */
72
+ declare enum OAuthProvider {
73
+ GOOGLE = "google",
74
+ FACEBOOK = "facebook"
75
+ }
76
+
68
77
  interface SuccessResponse<T> {
69
78
  success: true;
70
79
  data: T;
@@ -153,6 +162,84 @@ interface LoginResponseDto {
153
162
  user: LoggedInUserDto;
154
163
  }
155
164
 
165
+ interface VerifyEmailDto {
166
+ token: string;
167
+ }
168
+ interface ResendVerificationDto {
169
+ email: string;
170
+ }
171
+ interface VerificationResponseDto {
172
+ success: boolean;
173
+ message: string;
174
+ }
175
+
176
+ interface ForgotPasswordDto {
177
+ email: string;
178
+ }
179
+ interface ResetPasswordDto {
180
+ token: string;
181
+ newPassword: string;
182
+ }
183
+
184
+ /**
185
+ * OAuth Authentication DTOs
186
+ * Used for third-party authentication (Google, Facebook)
187
+ */
188
+ /**
189
+ * OAuth user data received from provider after authentication
190
+ */
191
+ interface OAuthUserDto {
192
+ /** Email from OAuth provider */
193
+ email: string;
194
+ /** First name from OAuth profile */
195
+ firstName?: string;
196
+ /** Last name from OAuth profile */
197
+ lastName?: string;
198
+ /** OAuth provider name (google, facebook) */
199
+ provider: string;
200
+ /** Unique user ID from the OAuth provider */
201
+ providerId: string;
202
+ /** OAuth access token (optional, for API calls) */
203
+ accessToken?: string;
204
+ /** OAuth refresh token (optional, for token refresh) */
205
+ refreshToken?: string;
206
+ /** Profile photo URL from OAuth provider */
207
+ profilePhoto?: string;
208
+ /** Account type for new registrations */
209
+ accountType?: 'customer' | 'business';
210
+ }
211
+ /**
212
+ * DTO for initiating OAuth flow
213
+ */
214
+ interface OAuthInitiateDto {
215
+ /** Account type - required for new user registration */
216
+ accountType: 'customer' | 'business';
217
+ }
218
+ /**
219
+ * OAuth error response when authentication fails
220
+ */
221
+ interface OAuthErrorResponseDto {
222
+ /** Error code for programmatic handling */
223
+ code: string;
224
+ /** Human-readable error message */
225
+ message: string;
226
+ /** Existing auth method if email conflict (e.g., 'email', 'google', 'facebook') */
227
+ existingAuthMethod?: string;
228
+ }
229
+ /**
230
+ * OAuth callback query parameters
231
+ */
232
+ interface OAuthCallbackQueryDto {
233
+ /** OAuth authorization code */
234
+ code?: string;
235
+ /** State parameter (contains accountType) */
236
+ state?: string;
237
+ /** Error from OAuth provider */
238
+ error?: string;
239
+ /** Error description from OAuth provider */
240
+ error_description?: string;
241
+ }
242
+
156
243
  interface CreateUserDto {
157
244
  email: string;
158
245
  password: string;
@@ -191,6 +278,27 @@ interface UserResponseDto extends UserDto {
191
278
  lastActive?: string;
192
279
  }
193
280
 
281
+ /**
282
+ * Full image DTO with all metadata for detailed views
283
+ */
284
+ interface ImageDto {
285
+ id: string;
286
+ url: string;
287
+ thumbnailUrl?: string;
288
+ width: number;
289
+ height: number;
290
+ mimeType: string;
291
+ dominantColor?: string;
292
+ }
293
+ /**
294
+ * Minimal image reference for list views
295
+ */
296
+ interface ImageRefDto {
297
+ id: string;
298
+ url: string;
299
+ thumbnailUrl?: string;
300
+ }
301
+
194
302
  interface CreateBusinessDto {
195
303
  name: string;
196
304
  email: string;
@@ -234,6 +342,8 @@ interface BusinessListItemDto {
234
342
  industryType?: string;
235
343
  activeProgramCount?: number;
236
344
  totalCustomers?: number;
345
+ profileImage?: ImageRefDto;
346
+ images?: ImageRefDto[];
237
347
  }
238
348
  /**
239
349
  * Detailed business DTO for admin views
@@ -307,9 +417,11 @@ interface LoyaltyProgramDto {
307
417
  id: string;
308
418
  businessId: string;
309
419
  name: string;
420
+ description?: string;
310
421
  isActive: boolean;
311
422
  createdAt: string;
312
423
  updatedAt: string;
424
+ coverImage?: ImageRefDto;
313
425
  }
314
426
 
315
- export { type ApiResponse, type BusinessDetailDto, type BusinessDto, type BusinessListItemDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerAdminResponseDto, type CustomerDto, type CustomerResponseDto, type ErrorDetail, type ErrorResponse, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto, type UserResponseDto };
427
+ export { type ApiResponse, type BusinessDetailDto, type BusinessDto, type BusinessListItemDto, BusinessStatus, type CreateBusinessDto, type CreateCustomerDto, type CreateLoyaltyProgramDto, type CreateUserDto, type CustomerAdminResponseDto, type CustomerDto, type CustomerResponseDto, type ErrorDetail, type ErrorResponse, type ForgotPasswordDto, type ImageDto, type ImageRefDto, type LoggedInUserDto, type LoginDto, type LoginResponseDto, type LoyaltyProgramDto, type OAuthCallbackQueryDto, type OAuthErrorResponseDto, type OAuthInitiateDto, OAuthProvider, type OAuthUserDto, type PaginatedResult, type PaginationMeta, type PaginationQuery, Permission, type RefreshTokenDto, type RegisterDto, type ResendVerificationDto, type ResetPasswordDto, Role, type SuccessResponse, type UpdateBusinessDto, type UpdateCustomerDto, type UpdateLoyaltyProgramDto, type UpdateUserDto, type UserDto, type UserResponseDto, type VerificationResponseDto, type VerifyEmailDto };
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  BusinessStatus: () => BusinessStatus,
24
+ OAuthProvider: () => OAuthProvider,
24
25
  Permission: () => Permission,
25
26
  Role: () => Role
26
27
  });
@@ -98,9 +99,17 @@ var BusinessStatus = /* @__PURE__ */ ((BusinessStatus2) => {
98
99
  BusinessStatus2["SUSPENDED"] = "suspended";
99
100
  return BusinessStatus2;
100
101
  })(BusinessStatus || {});
102
+
103
+ // src/enums/oauth-provider.enum.ts
104
+ var OAuthProvider = /* @__PURE__ */ ((OAuthProvider2) => {
105
+ OAuthProvider2["GOOGLE"] = "google";
106
+ OAuthProvider2["FACEBOOK"] = "facebook";
107
+ return OAuthProvider2;
108
+ })(OAuthProvider || {});
101
109
  // Annotate the CommonJS export names for ESM import in node:
102
110
  0 && (module.exports = {
103
111
  BusinessStatus,
112
+ OAuthProvider,
104
113
  Permission,
105
114
  Role
106
115
  });
package/dist/index.mjs CHANGED
@@ -70,8 +70,16 @@ var BusinessStatus = /* @__PURE__ */ ((BusinessStatus2) => {
70
70
  BusinessStatus2["SUSPENDED"] = "suspended";
71
71
  return BusinessStatus2;
72
72
  })(BusinessStatus || {});
73
+
74
+ // src/enums/oauth-provider.enum.ts
75
+ var OAuthProvider = /* @__PURE__ */ ((OAuthProvider2) => {
76
+ OAuthProvider2["GOOGLE"] = "google";
77
+ OAuthProvider2["FACEBOOK"] = "facebook";
78
+ return OAuthProvider2;
79
+ })(OAuthProvider || {});
73
80
  export {
74
81
  BusinessStatus,
82
+ OAuthProvider,
75
83
  Permission,
76
84
  Role
77
85
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loyal-ix/loyalix-shared-types",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Shared TypeScript types for Loyalix frontend and backend",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",