@esb-market-contracts/admin-backend 1.1.3 → 1.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.
- package/package.json +1 -1
- package/types.d.ts +36 -0
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -7,11 +7,47 @@ declare const AuthLoginSchema: z.ZodObject<{
|
|
|
7
7
|
password: z.ZodString;
|
|
8
8
|
}, z.core.$strict>;
|
|
9
9
|
export type AuthLogin = z.infer<typeof AuthLoginSchema>;
|
|
10
|
+
declare const AuthLoginResultSchema: z.ZodObject<{
|
|
11
|
+
tokenHash: z.ZodString;
|
|
12
|
+
expiresAt: z.ZodDate;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type AuthLoginResult = z.infer<typeof AuthLoginResultSchema>;
|
|
10
15
|
declare const AuthSessionHeaderSchema: z.ZodObject<{
|
|
11
16
|
"x-session-token-hash": z.ZodString;
|
|
12
17
|
}, z.core.$strict>;
|
|
13
18
|
export type AuthSessionHeader = z.infer<typeof AuthSessionHeaderSchema>;
|
|
19
|
+
declare const AuthSessionSchema: z.ZodObject<{
|
|
20
|
+
tokenHash: z.ZodString;
|
|
21
|
+
expiresAt: z.ZodDate;
|
|
22
|
+
user: z.ZodObject<{
|
|
23
|
+
id: z.ZodInt;
|
|
24
|
+
email: z.ZodString;
|
|
25
|
+
fullName: z.ZodString;
|
|
26
|
+
status: z.ZodEnum<{
|
|
27
|
+
active: "active";
|
|
28
|
+
inactive: "inactive";
|
|
29
|
+
suspended: "suspended";
|
|
30
|
+
}>;
|
|
31
|
+
lastLoginAt: z.ZodNullable<z.ZodDate>;
|
|
32
|
+
}, {
|
|
33
|
+
out: {};
|
|
34
|
+
in: {};
|
|
35
|
+
}>;
|
|
36
|
+
}, {
|
|
37
|
+
out: {};
|
|
38
|
+
in: {};
|
|
39
|
+
}>;
|
|
40
|
+
export type AuthSession = z.infer<typeof AuthSessionSchema>;
|
|
41
|
+
/**
|
|
42
|
+
* Type utility that recursively transforms all Date fields to string, as well as handling arrays and objects.
|
|
43
|
+
* This is necessary for proper typing when working with RPC, as JSON does not support the Date type directly.
|
|
44
|
+
*/
|
|
45
|
+
export type SerializeDates<T> = T extends Date ? string : T extends (infer U)[] ? SerializeDates<U>[] : T extends readonly (infer U)[] ? readonly SerializeDates<U>[] : T extends object ? {
|
|
46
|
+
[K in keyof T]: SerializeDates<T[K]>;
|
|
47
|
+
} : T;
|
|
14
48
|
export type AuthLoginRequest = AuthLogin;
|
|
49
|
+
export type AuthLoginResponse = SerializeDates<AuthLoginResult>;
|
|
15
50
|
export type AuthSessionRequest = AuthSessionHeader;
|
|
51
|
+
export type AuthSessionResponse = SerializeDates<AuthSession>;
|
|
16
52
|
|
|
17
53
|
export {};
|