@loyal-ix/loyalix-shared-types 1.1.0 → 1.2.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 +88 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.js +9 -0
- package/dist/index.mjs +8 -0
- package/package.json +1 -1
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;
|
|
@@ -312,4 +399,4 @@ interface LoyaltyProgramDto {
|
|
|
312
399
|
updatedAt: string;
|
|
313
400
|
}
|
|
314
401
|
|
|
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 };
|
|
402
|
+
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 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;
|
|
@@ -312,4 +399,4 @@ interface LoyaltyProgramDto {
|
|
|
312
399
|
updatedAt: string;
|
|
313
400
|
}
|
|
314
401
|
|
|
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 };
|
|
402
|
+
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 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
|
};
|