@turndown/library 0.1.3 → 0.1.5

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.
@@ -3,7 +3,7 @@ export * from "./routes";
3
3
  * Authentication Types
4
4
  * Request/Response types for authentication endpoints
5
5
  */
6
- import { AccountType, DeviceInfo, UserSafe } from "../user";
6
+ import { UserSafe } from "../user";
7
7
  /**
8
8
  * Token Payload
9
9
  * JWT token payload structure
@@ -30,111 +30,6 @@ export interface AuthTokenResponse {
30
30
  expiresAt: string;
31
31
  companyId?: string;
32
32
  }
33
- /**
34
- * Signup Request
35
- * Request body for user signup
36
- */
37
- export interface SignupRequest {
38
- email: string;
39
- password: string;
40
- firstName: string;
41
- lastName?: string;
42
- accountType: AccountType;
43
- deviceInfo?: DeviceInfo;
44
- }
45
- /**
46
- * Signup Response
47
- * Response from signup endpoint
48
- */
49
- export interface SignupResponse extends AuthTokenResponse {
50
- }
51
- /**
52
- * Signin Request
53
- * Request body for user signin
54
- */
55
- export interface SigninRequest {
56
- email: string;
57
- password: string;
58
- deviceInfo?: DeviceInfo;
59
- }
60
- /**
61
- * Signin Response
62
- * Response from signin endpoint
63
- */
64
- export interface SigninResponse extends AuthTokenResponse {
65
- passwordResetRequired?: boolean;
66
- }
67
- /**
68
- * Refresh Token Request
69
- * Request body for token refresh
70
- */
71
- export interface RefreshTokenRequest {
72
- refreshToken: string;
73
- deviceInfo?: DeviceInfo;
74
- }
75
- /**
76
- * Refresh Token Response
77
- * Response from token refresh endpoint
78
- */
79
- export interface RefreshTokenResponse extends AuthTokenResponse {
80
- }
81
- /**
82
- * Signout Request
83
- * Request body for signout
84
- */
85
- export interface SignoutRequest {
86
- refreshToken: string;
87
- }
88
- /**
89
- * Signout All Request
90
- * Request body for signing out from all devices
91
- */
92
- export interface SignoutAllRequest {
93
- userId: string;
94
- }
95
- /**
96
- * Get User Request
97
- * Request parameters for getting user info
98
- */
99
- export interface GetUserRequest {
100
- userId?: string;
101
- email?: string;
102
- }
103
- /**
104
- * Get User Response
105
- * Response from get user endpoint
106
- */
107
- export interface GetUserResponse {
108
- user: UserSafe | null;
109
- }
110
- /**
111
- * Change Password Request
112
- * Request body for changing password
113
- */
114
- export interface ChangePasswordRequest {
115
- currentPassword: string;
116
- newPassword: string;
117
- }
118
- /**
119
- * Change Password Response
120
- * Response from change password endpoint
121
- */
122
- export interface ChangePasswordResponse extends GetUserResponse {
123
- }
124
- /**
125
- * Forgot Password Request
126
- * Request body for forgot password
127
- */
128
- export interface ForgotPasswordRequest {
129
- email: string;
130
- }
131
- /**
132
- * Forgot Password Response
133
- * Response from forgot password endpoint
134
- */
135
- export interface ForgotPasswordResponse {
136
- message: string;
137
- }
138
33
  /**
139
34
  * Password Validation Rules
140
35
  * Rules for password validation
@@ -172,51 +67,3 @@ export interface RateLimitStatus {
172
67
  maxAttempts: number;
173
68
  resetTime?: string;
174
69
  }
175
- export interface SignupWithInvitationRequest {
176
- token: string;
177
- password: string;
178
- firstName: string;
179
- lastName?: string;
180
- deviceInfo?: DeviceInfo;
181
- }
182
- export interface InvitationValidationResponse {
183
- id: string;
184
- companyId: string;
185
- companyName: string;
186
- email: string;
187
- role: AccountType;
188
- invitedBy: string;
189
- invitedByName: string;
190
- expiresAt: string;
191
- userExists: boolean;
192
- }
193
- export interface AcceptInvitationRequest {
194
- userId: string;
195
- token: string;
196
- }
197
- export interface AcceptInvitationResponse {
198
- companyId: string;
199
- companyName: string;
200
- role: AccountType;
201
- }
202
- export interface GetPendingInvitationsResponse {
203
- id: string;
204
- token: string;
205
- companyId: string;
206
- companyName: string;
207
- role: AccountType;
208
- invitedBy: string;
209
- invitedByName: string;
210
- expiresAt: string;
211
- createdAt: string;
212
- }
213
- export interface RevokeInvitationRequest {
214
- invitationId: string;
215
- revokedBy: string;
216
- }
217
- export interface GetActiveSessionsResponse {
218
- id: string;
219
- deviceInfo: string;
220
- createdAt: string;
221
- lastUsedAt: string;
222
- }
@@ -1,64 +1,130 @@
1
+ import { AuthTokenResponse } from "..";
2
+ import { AccountType, DeviceInfo } from "../user";
3
+ import { GetUserResponse } from "../user/routes";
1
4
  export interface SignupRequest {
5
+ email: string;
6
+ password: string;
7
+ firstName: string;
8
+ lastName?: string;
9
+ accountType: AccountType;
10
+ deviceInfo?: DeviceInfo;
2
11
  }
3
- export interface SignupResponse {
12
+ export interface SignupResponse extends AuthTokenResponse {
4
13
  }
5
14
  export interface SigninRequest {
15
+ email: string;
16
+ password: string;
17
+ deviceInfo?: DeviceInfo;
6
18
  }
7
- export interface SigninResponse {
19
+ export interface SigninResponse extends AuthTokenResponse {
20
+ passwordResetRequired?: boolean;
8
21
  }
9
22
  export interface RefreshRequest {
23
+ refreshToken: string;
24
+ deviceInfo?: DeviceInfo;
10
25
  }
11
- export interface RefreshResponse {
26
+ export interface RefreshResponse extends AuthTokenResponse {
12
27
  }
13
28
  export interface SignoutRequest {
29
+ refreshToken: string;
14
30
  }
15
31
  export interface SignoutResponse {
32
+ message: string;
16
33
  }
17
34
  export interface SignoutAllRequest {
35
+ userId: string;
18
36
  }
19
37
  export interface SignoutAllResponse {
38
+ message: string;
20
39
  }
21
40
  export interface GetMeRequest {
22
41
  }
23
- export interface GetMeResponse {
42
+ export interface GetMeResponse extends GetUserResponse {
24
43
  }
25
44
  export interface GetSessionsRequest {
26
45
  }
27
46
  export interface GetSessionsResponse {
47
+ id: string;
48
+ deviceInfo: string;
49
+ createdAt: string;
50
+ lastUsedAt: string;
28
51
  }
29
52
  export interface RevokeSessionRequest {
30
53
  }
31
54
  export interface RevokeSessionResponse {
55
+ message: string;
32
56
  }
33
57
  export interface ChangePasswordRequest {
58
+ currentPassword: string;
59
+ newPassword: string;
34
60
  }
35
- export interface ChangePasswordResponse {
61
+ export interface ChangePasswordResponse extends GetUserResponse {
36
62
  }
37
63
  export interface ForgotPasswordRequest {
64
+ email: string;
38
65
  }
39
66
  export interface ForgotPasswordResponse {
67
+ message: string;
40
68
  }
41
69
  export interface GetSignInHistoryRequest {
42
70
  }
43
71
  export interface GetSignInHistoryResponse {
72
+ id: string;
73
+ email: string;
74
+ ipAddress: string;
75
+ userAgent: string;
76
+ success: boolean;
77
+ failureReason?: string;
78
+ createdAt: Date;
44
79
  }
45
80
  export interface ValidateInvitationRequest {
46
81
  }
47
82
  export interface ValidateInvitationResponse {
83
+ id: string;
84
+ companyId: string;
85
+ companyName: string;
86
+ email: string;
87
+ role: AccountType;
88
+ invitedBy: string;
89
+ invitedByName: string;
90
+ expiresAt: string;
91
+ userExists: boolean;
48
92
  }
49
93
  export interface SignupWithInvitationRequest {
94
+ token: string;
95
+ password: string;
96
+ firstName: string;
97
+ lastName?: string;
98
+ deviceInfo?: DeviceInfo;
50
99
  }
51
- export interface SignupWithInvitationResponse {
100
+ export interface SignupWithInvitationResponse extends AuthTokenResponse {
52
101
  }
53
102
  export interface AcceptInvitationRequest {
103
+ userId: string;
104
+ token: string;
54
105
  }
55
106
  export interface AcceptInvitationResponse {
107
+ companyId: string;
108
+ companyName: string;
109
+ role: AccountType;
56
110
  }
57
111
  export interface GetPendingInvitationsRequest {
58
112
  }
59
113
  export interface GetPendingInvitationsResponse {
114
+ id: string;
115
+ token: string;
116
+ companyId: string;
117
+ companyName: string;
118
+ role: AccountType;
119
+ invitedBy: string;
120
+ invitedByName: string;
121
+ expiresAt: string;
122
+ createdAt: string;
60
123
  }
61
124
  export interface RevokeInvitationRequest {
125
+ invitationId: string;
126
+ revokedBy: string;
62
127
  }
63
128
  export interface RevokeInvitationResponse {
129
+ message: string;
64
130
  }
@@ -3,7 +3,7 @@ export type TurndownObject<T = GenericTurndownObject> = Record<string, T> | T |
3
3
  export interface MetaData {
4
4
  createdAt: Date;
5
5
  updatedAt: Date;
6
- deletedAt: Date;
6
+ deletedAt?: Date;
7
7
  }
8
8
  export type ObjectValues<T> = T[keyof T];
9
9
  export type ObjectKeys<T> = [keyof T];
@@ -1,10 +1,20 @@
1
+ import { UserSafe } from "..";
2
+ export interface GetUserResponse {
3
+ user: UserSafe | null;
4
+ }
1
5
  export interface GetCurrentUserRequest {
2
6
  }
3
7
  export interface GetCurrentUserResponse {
4
8
  }
5
9
  export interface GetUserByIdRequest {
10
+ userId: string;
11
+ }
12
+ export interface GetUserByIdResponse extends GetUserResponse {
13
+ }
14
+ export interface GetUserByEmailRequest {
15
+ email: string;
6
16
  }
7
- export interface GetUserByIdResponse {
17
+ export interface GetUserByEmailResponse extends GetUserResponse {
8
18
  }
9
19
  export interface UpdateUserRequest {
10
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turndown/library",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Shared TypeScript library for the Turndown suite.",
5
5
  "keywords": [
6
6
  "types",