@esb-market-contracts/admin-backend 1.1.9 → 1.1.10

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.
Files changed (3) hide show
  1. package/api.d.ts +4 -0
  2. package/package.json +1 -1
  3. package/types.d.ts +9 -3
package/api.d.ts CHANGED
@@ -20,6 +20,10 @@ declare const authRouter: import("hono/hono-base").HonoBase<import("hono/types")
20
20
  status: "active" | "inactive" | "suspended";
21
21
  lastLoginAt: string | null;
22
22
  };
23
+ permissions: {
24
+ id: number;
25
+ code: string;
26
+ }[];
23
27
  };
24
28
  };
25
29
  outputFormat: "json";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@esb-market-contracts/admin-backend",
3
3
  "description": "Shared TypeScript contract definitions for admin-backend.",
4
- "version": "1.1.9",
4
+ "version": "1.1.10",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -7,8 +7,6 @@ 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<{}, z.core.$strict>;
11
- export type AuthLoginResult = z.infer<typeof AuthLoginResultSchema>;
12
10
  declare const AuthSessionSchema: z.ZodObject<{
13
11
  expiresAt: z.ZodDate;
14
12
  user: z.ZodObject<{
@@ -25,6 +23,13 @@ declare const AuthSessionSchema: z.ZodObject<{
25
23
  out: {};
26
24
  in: {};
27
25
  }>;
26
+ permissions: z.ZodArray<z.ZodObject<{
27
+ id: z.ZodInt;
28
+ code: z.ZodString;
29
+ }, {
30
+ out: {};
31
+ in: {};
32
+ }>>;
28
33
  }, {
29
34
  out: {};
30
35
  in: {};
@@ -33,12 +38,13 @@ export type AuthSession = z.infer<typeof AuthSessionSchema>;
33
38
  /**
34
39
  * Type utility that recursively transforms all Date fields to string, as well as handling arrays and objects.
35
40
  * This is necessary for proper typing when working with RPC, as JSON does not support the Date type directly.
41
+ * Example: SerializeDates<{ createdAt: Date; nested: { updatedAt: Date }; tags: Date[] }> \
42
+ * = { createdAt: string; nested: { updatedAt: string }; tags: string[] }
36
43
  */
37
44
  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 ? {
38
45
  [K in keyof T]: SerializeDates<T[K]>;
39
46
  } : T;
40
47
  export type AuthLoginRequest = AuthLogin;
41
- export type AuthLoginResponse = SerializeDates<AuthLoginResult>;
42
48
  export type AuthSessionRequest = Record<string, never>;
43
49
  export type AuthSessionResponse = SerializeDates<AuthSession>;
44
50
  export type AuthLogoutRequest = Record<string, never>;