@seamless-auth/types 0.1.2 → 0.2.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/CHANGELOG.md +36 -0
- package/README.md +30 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/schemas/admin/schema.d.ts +99 -0
- package/dist/schemas/admin/schema.d.ts.map +1 -0
- package/dist/schemas/admin/schema.js +38 -0
- package/dist/schemas/admin/schema.js.map +1 -0
- package/dist/schemas/auth/auth.schema.d.ts +158 -0
- package/dist/schemas/auth/auth.schema.d.ts.map +1 -1
- package/dist/schemas/auth/auth.schema.js +82 -0
- package/dist/schemas/auth/auth.schema.js.map +1 -1
- package/dist/schemas/authEvent/schema.d.ts +251 -0
- package/dist/schemas/authEvent/schema.d.ts.map +1 -1
- package/dist/schemas/authEvent/schema.js +94 -1
- package/dist/schemas/authEvent/schema.js.map +1 -1
- package/dist/schemas/common/schema.d.ts +23 -0
- package/dist/schemas/common/schema.d.ts.map +1 -0
- package/dist/schemas/common/schema.js +19 -0
- package/dist/schemas/common/schema.js.map +1 -0
- package/dist/schemas/credential/schema.d.ts +86 -0
- package/dist/schemas/credential/schema.d.ts.map +1 -1
- package/dist/schemas/credential/schema.js +31 -3
- package/dist/schemas/credential/schema.js.map +1 -1
- package/dist/schemas/me/schema.d.ts +104 -0
- package/dist/schemas/me/schema.d.ts.map +1 -0
- package/dist/schemas/me/schema.js +24 -0
- package/dist/schemas/me/schema.js.map +1 -0
- package/dist/schemas/messaging/schema.d.ts +73 -0
- package/dist/schemas/messaging/schema.d.ts.map +1 -0
- package/dist/schemas/messaging/schema.js +63 -0
- package/dist/schemas/messaging/schema.js.map +1 -0
- package/dist/schemas/metrics/schema.d.ts +86 -0
- package/dist/schemas/metrics/schema.d.ts.map +1 -0
- package/dist/schemas/metrics/schema.js +79 -0
- package/dist/schemas/metrics/schema.js.map +1 -0
- package/dist/schemas/oauth/schema.d.ts +68 -0
- package/dist/schemas/oauth/schema.d.ts.map +1 -0
- package/dist/schemas/oauth/schema.js +43 -0
- package/dist/schemas/oauth/schema.js.map +1 -0
- package/dist/schemas/organization/schema.d.ts +228 -0
- package/dist/schemas/organization/schema.d.ts.map +1 -0
- package/dist/schemas/organization/schema.js +90 -0
- package/dist/schemas/organization/schema.js.map +1 -0
- package/dist/schemas/role/schema.d.ts +20 -0
- package/dist/schemas/role/schema.d.ts.map +1 -0
- package/dist/schemas/role/schema.js +58 -0
- package/dist/schemas/role/schema.js.map +1 -0
- package/dist/schemas/session/schema.d.ts +17 -0
- package/dist/schemas/session/schema.d.ts.map +1 -1
- package/dist/schemas/session/schema.js +7 -0
- package/dist/schemas/session/schema.js.map +1 -1
- package/dist/schemas/stepUp/schema.d.ts +31 -0
- package/dist/schemas/stepUp/schema.d.ts.map +1 -0
- package/dist/schemas/stepUp/schema.js +19 -0
- package/dist/schemas/stepUp/schema.js.map +1 -0
- package/dist/schemas/systemConfig/schema.d.ts +368 -0
- package/dist/schemas/systemConfig/schema.d.ts.map +1 -0
- package/dist/schemas/systemConfig/schema.js +141 -0
- package/dist/schemas/systemConfig/schema.js.map +1 -0
- package/dist/schemas/totp/schema.d.ts +26 -0
- package/dist/schemas/totp/schema.d.ts.map +1 -0
- package/dist/schemas/totp/schema.js +23 -0
- package/dist/schemas/totp/schema.js.map +1 -0
- package/dist/schemas/user/schema.d.ts +54 -3
- package/dist/schemas/user/schema.d.ts.map +1 -1
- package/dist/schemas/user/schema.js +34 -7
- package/dist/schemas/user/schema.js.map +1 -1
- package/dist/schemas/webauthn/schema.d.ts +61 -0
- package/dist/schemas/webauthn/schema.d.ts.map +1 -0
- package/dist/schemas/webauthn/schema.js +58 -0
- package/dist/schemas/webauthn/schema.js.map +1 -0
- package/package.json +23 -7
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OrganizationIdParamSchema: z.ZodObject<{
|
|
3
|
+
organizationId: z.ZodUUID;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const OrganizationMemberParamSchema: z.ZodObject<{
|
|
6
|
+
organizationId: z.ZodUUID;
|
|
7
|
+
userId: z.ZodUUID;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const CreateOrganizationRequestSchema: z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
12
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type CreateOrganizationRequest = z.infer<typeof CreateOrganizationRequestSchema>;
|
|
15
|
+
export declare const UpdateOrganizationRequestSchema: z.ZodObject<{
|
|
16
|
+
name: z.ZodOptional<z.ZodString>;
|
|
17
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
18
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type UpdateOrganizationRequest = z.infer<typeof UpdateOrganizationRequestSchema>;
|
|
21
|
+
export declare const AddOrganizationMemberRequestSchema: z.ZodObject<{
|
|
22
|
+
userId: z.ZodOptional<z.ZodUUID>;
|
|
23
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
24
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type AddOrganizationMemberRequest = z.infer<typeof AddOrganizationMemberRequestSchema>;
|
|
28
|
+
export declare const UpdateOrganizationMemberRequestSchema: z.ZodObject<{
|
|
29
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
30
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type UpdateOrganizationMemberRequest = z.infer<typeof UpdateOrganizationMemberRequestSchema>;
|
|
33
|
+
export declare const OrganizationMembershipSchema: z.ZodObject<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
organizationId: z.ZodString;
|
|
36
|
+
userId: z.ZodString;
|
|
37
|
+
roles: z.ZodArray<z.ZodString>;
|
|
38
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
39
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
40
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
41
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
email: z.ZodEmail;
|
|
44
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
45
|
+
roles: z.ZodArray<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type OrganizationMembership = z.infer<typeof OrganizationMembershipSchema>;
|
|
49
|
+
export declare const OrganizationSchema: z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
slug: z.ZodString;
|
|
53
|
+
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
54
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
55
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
56
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
57
|
+
membership: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
organizationId: z.ZodString;
|
|
60
|
+
userId: z.ZodString;
|
|
61
|
+
roles: z.ZodArray<z.ZodString>;
|
|
62
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
63
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
64
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
65
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
email: z.ZodEmail;
|
|
68
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
69
|
+
roles: z.ZodArray<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export type Organization = z.infer<typeof OrganizationSchema>;
|
|
75
|
+
export declare const OrganizationEnvelopeResponseSchema: z.ZodObject<{
|
|
76
|
+
organization: z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
slug: z.ZodString;
|
|
80
|
+
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
81
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
83
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
84
|
+
membership: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
organizationId: z.ZodString;
|
|
87
|
+
userId: z.ZodString;
|
|
88
|
+
roles: z.ZodArray<z.ZodString>;
|
|
89
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
90
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
91
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
92
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
email: z.ZodEmail;
|
|
95
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
96
|
+
roles: z.ZodArray<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const OrganizationListResponseSchema: z.ZodObject<{
|
|
103
|
+
organizations: z.ZodArray<z.ZodObject<{
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
slug: z.ZodString;
|
|
107
|
+
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
108
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
109
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
110
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
111
|
+
membership: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
id: z.ZodString;
|
|
113
|
+
organizationId: z.ZodString;
|
|
114
|
+
userId: z.ZodString;
|
|
115
|
+
roles: z.ZodArray<z.ZodString>;
|
|
116
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
117
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
118
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
119
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
email: z.ZodEmail;
|
|
122
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
123
|
+
roles: z.ZodArray<z.ZodString>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
activeOrganizationId: z.ZodNullable<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
export type OrganizationListResponse = z.infer<typeof OrganizationListResponseSchema>;
|
|
131
|
+
export declare const AdminOrganizationListResponseSchema: z.ZodObject<{
|
|
132
|
+
organizations: z.ZodArray<z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
slug: z.ZodString;
|
|
136
|
+
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
137
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
139
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
140
|
+
membership: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
organizationId: z.ZodString;
|
|
143
|
+
userId: z.ZodString;
|
|
144
|
+
roles: z.ZodArray<z.ZodString>;
|
|
145
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
146
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
147
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
148
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
email: z.ZodEmail;
|
|
151
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
152
|
+
roles: z.ZodArray<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
total: z.ZodNumber;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export declare const OrganizationMembersResponseSchema: z.ZodObject<{
|
|
160
|
+
members: z.ZodArray<z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
organizationId: z.ZodString;
|
|
163
|
+
userId: z.ZodString;
|
|
164
|
+
roles: z.ZodArray<z.ZodString>;
|
|
165
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
166
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
167
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
168
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
email: z.ZodEmail;
|
|
171
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
172
|
+
roles: z.ZodArray<z.ZodString>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
total: z.ZodNumber;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export declare const OrganizationMembershipEnvelopeResponseSchema: z.ZodObject<{
|
|
178
|
+
membership: z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
organizationId: z.ZodString;
|
|
181
|
+
userId: z.ZodString;
|
|
182
|
+
roles: z.ZodArray<z.ZodString>;
|
|
183
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
184
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
185
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
186
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
187
|
+
id: z.ZodString;
|
|
188
|
+
email: z.ZodEmail;
|
|
189
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
190
|
+
roles: z.ZodArray<z.ZodString>;
|
|
191
|
+
}, z.core.$strip>>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
export declare const OrganizationSwitchResponseSchema: z.ZodObject<{
|
|
195
|
+
message: z.ZodString;
|
|
196
|
+
token: z.ZodString;
|
|
197
|
+
sub: z.ZodString;
|
|
198
|
+
sessionId: z.ZodString;
|
|
199
|
+
organizationId: z.ZodString;
|
|
200
|
+
organization: z.ZodObject<{
|
|
201
|
+
id: z.ZodString;
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
slug: z.ZodString;
|
|
204
|
+
createdByUserId: z.ZodNullable<z.ZodString>;
|
|
205
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
206
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
207
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
208
|
+
membership: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
organizationId: z.ZodString;
|
|
211
|
+
userId: z.ZodString;
|
|
212
|
+
roles: z.ZodArray<z.ZodString>;
|
|
213
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
214
|
+
createdAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
215
|
+
updatedAt: z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>;
|
|
216
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
email: z.ZodEmail;
|
|
219
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
220
|
+
roles: z.ZodArray<z.ZodString>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
memberCount: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
ttl: z.ZodNumber;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type OrganizationSwitchResponse = z.infer<typeof OrganizationSwitchResponseSchema>;
|
|
228
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/organization/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,yBAAyB;;iBAEpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;iBAExC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;iBAI1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,+BAA+B;;;;iBAI1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAKxF,eAAO,MAAM,kCAAkC;;;;;iBAS3C,CAAC;AAEL,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,qCAAqC;;;iBAGhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AASpG,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;iBASvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;iBAU7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG9C,CAAC;AAEH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;iBAG5C,CAAC;AAEH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;iBAEvD,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IsoDate } from '../../shared.js';
|
|
3
|
+
import { MetadataSchema } from '../common/schema.js';
|
|
4
|
+
export const OrganizationIdParamSchema = z.object({
|
|
5
|
+
organizationId: z.uuid(),
|
|
6
|
+
});
|
|
7
|
+
export const OrganizationMemberParamSchema = OrganizationIdParamSchema.extend({
|
|
8
|
+
userId: z.uuid(),
|
|
9
|
+
});
|
|
10
|
+
export const CreateOrganizationRequestSchema = z.object({
|
|
11
|
+
name: z.string().trim().min(1).max(120),
|
|
12
|
+
slug: z.string().trim().min(1).max(100).optional(),
|
|
13
|
+
metadata: MetadataSchema,
|
|
14
|
+
});
|
|
15
|
+
export const UpdateOrganizationRequestSchema = z.object({
|
|
16
|
+
name: z.string().trim().min(1).max(120).optional(),
|
|
17
|
+
slug: z.string().trim().min(1).max(100).optional(),
|
|
18
|
+
metadata: MetadataSchema,
|
|
19
|
+
});
|
|
20
|
+
const MembershipRoleSchema = z.string().trim().min(1).max(80);
|
|
21
|
+
const MembershipScopeSchema = z.string().trim().min(1).max(120);
|
|
22
|
+
export const AddOrganizationMemberRequestSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
userId: z.uuid().optional(),
|
|
25
|
+
email: z.email().optional(),
|
|
26
|
+
roles: z.array(MembershipRoleSchema).optional(),
|
|
27
|
+
scopes: z.array(MembershipScopeSchema).optional(),
|
|
28
|
+
})
|
|
29
|
+
.refine((value) => Boolean(value.userId || value.email), {
|
|
30
|
+
message: 'userId or email is required',
|
|
31
|
+
});
|
|
32
|
+
export const UpdateOrganizationMemberRequestSchema = z.object({
|
|
33
|
+
roles: z.array(MembershipRoleSchema).optional(),
|
|
34
|
+
scopes: z.array(MembershipScopeSchema).optional(),
|
|
35
|
+
});
|
|
36
|
+
const OrganizationMembershipUserSchema = z.object({
|
|
37
|
+
id: z.string(),
|
|
38
|
+
email: z.email(),
|
|
39
|
+
phone: z.string().nullable(),
|
|
40
|
+
roles: z.array(z.string()),
|
|
41
|
+
});
|
|
42
|
+
export const OrganizationMembershipSchema = z.object({
|
|
43
|
+
id: z.string(),
|
|
44
|
+
organizationId: z.string(),
|
|
45
|
+
userId: z.string(),
|
|
46
|
+
roles: z.array(z.string()),
|
|
47
|
+
scopes: z.array(z.string()),
|
|
48
|
+
createdAt: IsoDate,
|
|
49
|
+
updatedAt: IsoDate,
|
|
50
|
+
user: OrganizationMembershipUserSchema.optional(),
|
|
51
|
+
});
|
|
52
|
+
export const OrganizationSchema = z.object({
|
|
53
|
+
id: z.string(),
|
|
54
|
+
name: z.string(),
|
|
55
|
+
slug: z.string(),
|
|
56
|
+
createdByUserId: z.string().nullable(),
|
|
57
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
58
|
+
createdAt: IsoDate,
|
|
59
|
+
updatedAt: IsoDate,
|
|
60
|
+
membership: OrganizationMembershipSchema.optional(),
|
|
61
|
+
memberCount: z.number().int().nonnegative().optional(),
|
|
62
|
+
});
|
|
63
|
+
export const OrganizationEnvelopeResponseSchema = z.object({
|
|
64
|
+
organization: OrganizationSchema,
|
|
65
|
+
});
|
|
66
|
+
export const OrganizationListResponseSchema = z.object({
|
|
67
|
+
organizations: z.array(OrganizationSchema),
|
|
68
|
+
activeOrganizationId: z.string().nullable(),
|
|
69
|
+
});
|
|
70
|
+
export const AdminOrganizationListResponseSchema = z.object({
|
|
71
|
+
organizations: z.array(OrganizationSchema),
|
|
72
|
+
total: z.number().int().nonnegative(),
|
|
73
|
+
});
|
|
74
|
+
export const OrganizationMembersResponseSchema = z.object({
|
|
75
|
+
members: z.array(OrganizationMembershipSchema),
|
|
76
|
+
total: z.number().int().nonnegative(),
|
|
77
|
+
});
|
|
78
|
+
export const OrganizationMembershipEnvelopeResponseSchema = z.object({
|
|
79
|
+
membership: OrganizationMembershipSchema,
|
|
80
|
+
});
|
|
81
|
+
export const OrganizationSwitchResponseSchema = z.object({
|
|
82
|
+
message: z.string(),
|
|
83
|
+
token: z.string(),
|
|
84
|
+
sub: z.string(),
|
|
85
|
+
sessionId: z.string(),
|
|
86
|
+
organizationId: z.string(),
|
|
87
|
+
organization: OrganizationSchema,
|
|
88
|
+
ttl: z.number(),
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas/organization/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,cAAc,EAAE,CAAC,CAAC,IAAI,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,yBAAyB,CAAC,MAAM,CAAC;IAC5E,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,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;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAAC,CAAC,MAAM,CAAC;IACnE,UAAU,EAAE,4BAA4B;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,YAAY,EAAE,kBAAkB;IAChC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Roles are colon-scoped (`billing:invoices:read`). Underscores, slashes, and
|
|
4
|
+
* whitespace are excluded so a role name is always safe to embed in a JWT claim,
|
|
5
|
+
* a URL path segment, and a config file without escaping.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ROLE_NAME_PATTERN: RegExp;
|
|
8
|
+
export declare const RoleNameSchema: z.ZodString;
|
|
9
|
+
export type RoleName = z.infer<typeof RoleNameSchema>;
|
|
10
|
+
/** @deprecated Use {@link RoleNameSchema}. */
|
|
11
|
+
export declare const RoleSchema: z.ZodString;
|
|
12
|
+
/**
|
|
13
|
+
* Whether a granted role satisfies a required role. A `:*` suffix grants every
|
|
14
|
+
* role under that prefix, an unscoped role grants every role beneath it, and a
|
|
15
|
+
* `:write` role implies the matching `:read` role.
|
|
16
|
+
*/
|
|
17
|
+
export declare function roleGrantsAccess(grantedRole: string, requiredRole: string): boolean;
|
|
18
|
+
/** Whether any granted role satisfies at least one of the required roles. */
|
|
19
|
+
export declare function hasScopedRole(grantedRoles: unknown, requiredRoles: string | string[]): boolean;
|
|
20
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/role/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAiE,CAAC;AAEhG,eAAO,MAAM,cAAc,aAA6C,CAAC;AAEzE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,8CAA8C;AAC9C,eAAO,MAAM,UAAU,aAAiB,CAAC;AAUzC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAmCnF;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAW9F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Roles are colon-scoped (`billing:invoices:read`). Underscores, slashes, and
|
|
4
|
+
* whitespace are excluded so a role name is always safe to embed in a JWT claim,
|
|
5
|
+
* a URL path segment, and a config file without escaping.
|
|
6
|
+
*/
|
|
7
|
+
export const ROLE_NAME_PATTERN = /^(?!.*[_/\\\s])(?=.{1,80}$)[A-Za-z0-9-]+(?::[A-Za-z0-9-]+)*$/;
|
|
8
|
+
export const RoleNameSchema = z.string().trim().regex(ROLE_NAME_PATTERN);
|
|
9
|
+
/** @deprecated Use {@link RoleNameSchema}. */
|
|
10
|
+
export const RoleSchema = RoleNameSchema;
|
|
11
|
+
function normalizeRole(value) {
|
|
12
|
+
return value.trim();
|
|
13
|
+
}
|
|
14
|
+
function samePrefix(left, right) {
|
|
15
|
+
return left.length === right.length && left.every((part, index) => part === right[index]);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Whether a granted role satisfies a required role. A `:*` suffix grants every
|
|
19
|
+
* role under that prefix, an unscoped role grants every role beneath it, and a
|
|
20
|
+
* `:write` role implies the matching `:read` role.
|
|
21
|
+
*/
|
|
22
|
+
export function roleGrantsAccess(grantedRole, requiredRole) {
|
|
23
|
+
const granted = normalizeRole(grantedRole);
|
|
24
|
+
const required = normalizeRole(requiredRole);
|
|
25
|
+
if (!granted || !required) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (granted === required) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (granted.endsWith(':*')) {
|
|
32
|
+
const prefix = granted.slice(0, -2);
|
|
33
|
+
return required === prefix || required.startsWith(`${prefix}:`);
|
|
34
|
+
}
|
|
35
|
+
if (!required.includes(':')) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (!granted.includes(':')) {
|
|
39
|
+
return required.startsWith(`${granted}:`);
|
|
40
|
+
}
|
|
41
|
+
const grantedParts = granted.split(':');
|
|
42
|
+
const requiredParts = required.split(':');
|
|
43
|
+
const grantedAction = grantedParts[grantedParts.length - 1];
|
|
44
|
+
const requiredAction = requiredParts[requiredParts.length - 1];
|
|
45
|
+
return (grantedAction === 'write' &&
|
|
46
|
+
requiredAction === 'read' &&
|
|
47
|
+
samePrefix(grantedParts.slice(0, -1), requiredParts.slice(0, -1)));
|
|
48
|
+
}
|
|
49
|
+
/** Whether any granted role satisfies at least one of the required roles. */
|
|
50
|
+
export function hasScopedRole(grantedRoles, requiredRoles) {
|
|
51
|
+
if (!Array.isArray(grantedRoles)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const required = Array.isArray(requiredRoles) ? requiredRoles : [requiredRoles];
|
|
55
|
+
const granted = grantedRoles.filter((role) => typeof role === 'string');
|
|
56
|
+
return required.some((requiredRole) => granted.some((grantedRole) => roleGrantsAccess(grantedRole, requiredRole)));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas/role/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,8DAA8D,CAAC;AAEhG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAIzE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC;AAEzC,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,UAAU,CAAC,IAAc,EAAE,KAAe;IACjD,OAAO,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB,EAAE,YAAoB;IACxE,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;IAE7C,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAA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CAAC,aAAa,CAAC,CAAC;IAChF,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;IAExF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CACpC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -8,4 +8,21 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
8
8
|
expiresAt: z.ZodString;
|
|
9
9
|
current: z.ZodBoolean;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
|
+
export type Session = z.infer<typeof SessionSchema>;
|
|
12
|
+
export declare const SessionIdParamsSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const SessionListResponseSchema: z.ZodObject<{
|
|
16
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
deviceName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
ipAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
lastUsedAt: z.ZodString;
|
|
22
|
+
expiresAt: z.ZodString;
|
|
23
|
+
current: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
total: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type SessionListResponse = z.infer<typeof SessionListResponseSchema>;
|
|
11
28
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/session/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;iBAQxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/session/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;iBAQxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAGpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -8,4 +8,11 @@ export const SessionSchema = z.object({
|
|
|
8
8
|
expiresAt: z.string(),
|
|
9
9
|
current: z.boolean(),
|
|
10
10
|
});
|
|
11
|
+
export const SessionIdParamsSchema = z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
});
|
|
14
|
+
export const SessionListResponseSchema = z.object({
|
|
15
|
+
sessions: z.array(SessionSchema),
|
|
16
|
+
total: z.number(),
|
|
17
|
+
});
|
|
11
18
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas/session/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,E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
2
|
+
export declare const StepUpMethodSchema: z.ZodEnum<{
|
|
3
|
+
webauthn: "webauthn";
|
|
4
|
+
totp: "totp";
|
|
5
|
+
}>;
|
|
6
|
+
export type StepUpMethod = z.infer<typeof StepUpMethodSchema>;
|
|
7
|
+
/** Every field but `fresh` is null until the user has stepped up at least once. */
|
|
8
|
+
export declare const StepUpStatusSchema: z.ZodObject<{
|
|
9
|
+
fresh: z.ZodBoolean;
|
|
10
|
+
method: z.ZodNullable<z.ZodEnum<{
|
|
11
|
+
webauthn: "webauthn";
|
|
12
|
+
totp: "totp";
|
|
13
|
+
}>>;
|
|
14
|
+
verifiedAt: z.ZodNullable<z.ZodString>;
|
|
15
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
16
|
+
maxAgeSeconds: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type StepUpStatus = z.infer<typeof StepUpStatusSchema>;
|
|
19
|
+
export declare const StepUpSuccessSchema: z.ZodObject<{
|
|
20
|
+
message: z.ZodString;
|
|
21
|
+
fresh: z.ZodBoolean;
|
|
22
|
+
method: z.ZodEnum<{
|
|
23
|
+
webauthn: "webauthn";
|
|
24
|
+
totp: "totp";
|
|
25
|
+
}>;
|
|
26
|
+
verifiedAt: z.ZodString;
|
|
27
|
+
expiresAt: z.ZodString;
|
|
28
|
+
maxAgeSeconds: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type StepUpSuccessResponse = z.infer<typeof StepUpSuccessSchema>;
|
|
31
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schemas/stepUp/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;EAA+B,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,mFAAmF;AACnF,eAAO,MAAM,kBAAkB;;;;;;;;;iBAM7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAO9B,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const StepUpMethodSchema = z.enum(['webauthn', 'totp']);
|
|
3
|
+
/** Every field but `fresh` is null until the user has stepped up at least once. */
|
|
4
|
+
export const StepUpStatusSchema = z.object({
|
|
5
|
+
fresh: z.boolean(),
|
|
6
|
+
method: StepUpMethodSchema.nullable(),
|
|
7
|
+
verifiedAt: z.string().nullable(),
|
|
8
|
+
expiresAt: z.string().nullable(),
|
|
9
|
+
maxAgeSeconds: z.number(),
|
|
10
|
+
});
|
|
11
|
+
export const StepUpSuccessSchema = z.object({
|
|
12
|
+
message: z.string(),
|
|
13
|
+
fresh: z.boolean(),
|
|
14
|
+
method: StepUpMethodSchema,
|
|
15
|
+
verifiedAt: z.string(),
|
|
16
|
+
expiresAt: z.string(),
|
|
17
|
+
maxAgeSeconds: z.number(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schemas/stepUp/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAI/D,mFAAmF;AACnF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;IAClB,MAAM,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;IAClB,MAAM,EAAE,kBAAkB;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC"}
|