@markwharton/pwa-core 3.2.1 → 3.4.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/client.d.ts +116 -0
- package/dist/client.js +270 -0
- package/dist/server.d.ts +313 -6
- package/dist/server.js +697 -3
- package/dist/shared.d.ts +40 -0
- package/package.json +1 -1
package/dist/shared.d.ts
CHANGED
|
@@ -81,6 +81,46 @@ export interface RoleTokenPayload extends BaseJwtPayload {
|
|
|
81
81
|
role: 'admin' | 'viewer';
|
|
82
82
|
viewerTokenId?: string;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* User record for session-based authentication.
|
|
86
|
+
* Represents who the person is (from the Users table).
|
|
87
|
+
* Consumers can extend this interface for app-specific fields.
|
|
88
|
+
*/
|
|
89
|
+
export interface SessionUser {
|
|
90
|
+
id: string;
|
|
91
|
+
email: string;
|
|
92
|
+
isAdmin?: boolean;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
lastLoginAt?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Session record for session-based authentication.
|
|
98
|
+
* Represents an active login (from the Sessions table).
|
|
99
|
+
* Used for sliding window refresh, session listing, cleanup, and admin dashboards.
|
|
100
|
+
*/
|
|
101
|
+
export interface SessionInfo {
|
|
102
|
+
id: string;
|
|
103
|
+
userId: string;
|
|
104
|
+
email: string;
|
|
105
|
+
createdAt: string;
|
|
106
|
+
expiresAt: string;
|
|
107
|
+
lastAccessedAt: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Request body for magic link email requests.
|
|
111
|
+
*/
|
|
112
|
+
export interface MagicLinkRequest {
|
|
113
|
+
email: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Standard response for session auth operations.
|
|
117
|
+
*/
|
|
118
|
+
export interface SessionAuthResponse {
|
|
119
|
+
success: boolean;
|
|
120
|
+
user?: SessionUser;
|
|
121
|
+
message?: string;
|
|
122
|
+
error?: string;
|
|
123
|
+
}
|
|
84
124
|
/**
|
|
85
125
|
* Type guard to check if a JWT payload contains a username field.
|
|
86
126
|
* @param payload - The JWT payload to check
|