@esb-market-contracts/admin-backend 1.1.1 → 1.1.3

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