@esb-market-contracts/admin-backend 1.1.2 → 1.1.4

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 +20 -100
  2. package/package.json +1 -1
  3. package/types.d.ts +36 -13
package/api.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
- declare const sessionsRouter: import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
4
- "/iam/sessions/create": {
3
+ declare const authRouter: import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
4
+ "/iam/auth/login": {
5
5
  $post: {
6
6
  input: {
7
7
  json: {
8
- userId: number;
9
- tokenHash: string;
10
- ipAddress?: string | null | undefined;
8
+ email: string;
9
+ password: string;
11
10
  };
12
11
  };
13
12
  output: {
@@ -20,9 +19,8 @@ declare const sessionsRouter: import("hono/hono-base").HonoBase<import("hono/typ
20
19
  } | {
21
20
  input: {
22
21
  json: {
23
- userId: number;
24
- tokenHash: string;
25
- ipAddress?: string | null | undefined;
22
+ email: string;
23
+ password: string;
26
24
  };
27
25
  };
28
26
  output: {
@@ -33,12 +31,7 @@ declare const sessionsRouter: import("hono/hono-base").HonoBase<import("hono/typ
33
31
  kind: "data";
34
32
  status: import("@esb-market-contracts/core").SuccessStatusCode;
35
33
  data: {
36
- id: number;
37
- createdAt: string;
38
- userId: number;
39
34
  tokenHash: string;
40
- ipAddress: string | null;
41
- revokedAt: string | null;
42
35
  expiresAt: string;
43
36
  };
44
37
  };
@@ -47,11 +40,11 @@ declare const sessionsRouter: import("hono/hono-base").HonoBase<import("hono/typ
47
40
  };
48
41
  };
49
42
  } & {
50
- "/iam/sessions/get": {
43
+ "/iam/auth/session": {
51
44
  $get: {
52
45
  input: {
53
- query: {
54
- tokenHash: string;
46
+ header: {
47
+ "x-session-token-hash": string;
55
48
  };
56
49
  };
57
50
  output: {
@@ -63,8 +56,8 @@ declare const sessionsRouter: import("hono/hono-base").HonoBase<import("hono/typ
63
56
  status: 400;
64
57
  } | {
65
58
  input: {
66
- query: {
67
- tokenHash: string;
59
+ header: {
60
+ "x-session-token-hash": string;
68
61
  };
69
62
  };
70
63
  output: {
@@ -75,95 +68,22 @@ declare const sessionsRouter: import("hono/hono-base").HonoBase<import("hono/typ
75
68
  kind: "data";
76
69
  status: import("@esb-market-contracts/core").SuccessStatusCode;
77
70
  data: {
78
- id: number;
79
- createdAt: string;
80
- userId: number;
81
71
  tokenHash: string;
82
- ipAddress: string | null;
83
- revokedAt: string | null;
84
72
  expiresAt: string;
73
+ user: {
74
+ id: number;
75
+ email: string;
76
+ fullName: string;
77
+ status: "active" | "inactive" | "suspended";
78
+ lastLoginAt: string | null;
79
+ };
85
80
  };
86
81
  };
87
82
  outputFormat: "json";
88
83
  status: 400 | 401 | 403 | 404 | 405 | 409 | 500 | 200 | 201 | 202 | 307;
89
84
  };
90
85
  };
91
- } & {
92
- "/iam/sessions/get-active": {
93
- $get: {
94
- input: {
95
- query: {
96
- tokenHash: string;
97
- };
98
- };
99
- output: {
100
- kind: "error";
101
- status: import("@esb-market-contracts/core").ExceptionStatusCode;
102
- error: string;
103
- };
104
- outputFormat: "json";
105
- status: 400;
106
- } | {
107
- input: {
108
- query: {
109
- tokenHash: string;
110
- };
111
- };
112
- output: {
113
- kind: "error";
114
- status: import("@esb-market-contracts/core").ExceptionStatusCode;
115
- error: string;
116
- } | {
117
- kind: "data";
118
- status: import("@esb-market-contracts/core").SuccessStatusCode;
119
- data: {
120
- id: number;
121
- createdAt: string;
122
- userId: number;
123
- tokenHash: string;
124
- ipAddress: string | null;
125
- revokedAt: string | null;
126
- expiresAt: string;
127
- };
128
- };
129
- outputFormat: "json";
130
- status: 400 | 401 | 403 | 404 | 405 | 409 | 500 | 200 | 201 | 202 | 307;
131
- };
132
- };
133
- } & {
134
- "/iam/sessions/revoke": {
135
- $post: {
136
- input: {
137
- json: {
138
- id: number;
139
- };
140
- };
141
- output: {
142
- kind: "error";
143
- status: import("@esb-market-contracts/core").ExceptionStatusCode;
144
- error: string;
145
- };
146
- outputFormat: "json";
147
- status: 400;
148
- } | {
149
- input: {
150
- json: {
151
- id: number;
152
- };
153
- };
154
- output: {
155
- kind: "error";
156
- status: import("@esb-market-contracts/core").ExceptionStatusCode;
157
- error: string;
158
- } | {
159
- kind: "void";
160
- status: import("@esb-market-contracts/core").SuccessStatusCode;
161
- };
162
- outputFormat: "json";
163
- status: 400 | 401 | 403 | 404 | 405 | 409 | 500 | 200 | 201 | 202 | 307;
164
- };
165
- };
166
- }, "/iam/sessions", "/iam/sessions/revoke">;
167
- export type SessionsRouter = typeof sessionsRouter;
86
+ }, "/iam/auth", "/iam/auth/session">;
87
+ export type AuthRouter = typeof authRouter;
168
88
 
169
89
  export {};
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.2",
4
+ "version": "1.1.4",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -2,22 +2,45 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- declare const CreateSessionSchema: z.ZodObject<{
6
- userId: z.ZodInt;
7
- tokenHash: z.ZodString;
8
- ipAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ declare const AuthLoginSchema: z.ZodObject<{
6
+ email: z.ZodEmail;
7
+ password: z.ZodString;
9
8
  }, z.core.$strict>;
10
- export type CreateSession = z.infer<typeof CreateSessionSchema>;
11
- export type SessionsCreateRequest = CreateSession;
12
- declare const SelectSessionByTokenHashSchema: z.ZodObject<{
9
+ export type AuthLogin = z.infer<typeof AuthLoginSchema>;
10
+ declare const AuthLoginResultSchema: z.ZodObject<{
13
11
  tokenHash: z.ZodString;
12
+ expiresAt: z.ZodDate;
14
13
  }, z.core.$strict>;
15
- export type SelectSessionByTokenHash = z.infer<typeof SelectSessionByTokenHashSchema>;
16
- export type SessionsFindByTokenRequest = SelectSessionByTokenHash;
17
- declare const RevokeSessionSchema: z.ZodObject<{
18
- id: z.ZodInt;
14
+ export type AuthLoginResult = z.infer<typeof AuthLoginResultSchema>;
15
+ declare const AuthSessionHeaderSchema: z.ZodObject<{
16
+ "x-session-token-hash": z.ZodString;
19
17
  }, z.core.$strict>;
20
- export type RevokeSession = z.infer<typeof RevokeSessionSchema>;
21
- export type SessionsRevokeRequest = RevokeSession;
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
+ export type AuthLoginRequest = AuthLogin;
42
+ export type AuthLoginResponse = AuthLoginResult;
43
+ export type AuthSessionRequest = AuthSessionHeader;
44
+ export type AuthSessionResponse = AuthSession;
22
45
 
23
46
  export {};