@@ -63,10 +63,12 @@ export type SupportedTimezones =
6363
6464export interface Config {
6565 auth : {
66+ admins : AdminAuthOperations ;
6667 users : UserAuthOperations ;
6768 } ;
6869 blocks : { } ;
6970 collections : {
71+ admins : Admin ;
7072 users : User ;
7173 media : Media ;
7274 reports : Report ;
@@ -76,6 +78,7 @@ export interface Config {
7678 } ;
7779 collectionsJoins : { } ;
7880 collectionsSelect : {
81+ admins : AdminsSelect < false > | AdminsSelect < true > ;
7982 users : UsersSelect < false > | UsersSelect < true > ;
8083 media : MediaSelect < false > | MediaSelect < true > ;
8184 reports : ReportsSelect < false > | ReportsSelect < true > ;
@@ -89,14 +92,36 @@ export interface Config {
8992 globals : { } ;
9093 globalsSelect : { } ;
9194 locale : null ;
92- user : User & {
93- collection : 'users' ;
94- } ;
95+ user :
96+ | ( Admin & {
97+ collection : 'admins' ;
98+ } )
99+ | ( User & {
100+ collection : 'users' ;
101+ } ) ;
95102 jobs : {
96103 tasks : unknown ;
97104 workflows : unknown ;
98105 } ;
99106}
107+ export interface AdminAuthOperations {
108+ forgotPassword : {
109+ email : string ;
110+ password : string ;
111+ } ;
112+ login : {
113+ email : string ;
114+ password : string ;
115+ } ;
116+ registerFirstUser : {
117+ email : string ;
118+ password : string ;
119+ } ;
120+ unlock : {
121+ email : string ;
122+ password : string ;
123+ } ;
124+ }
100125export interface UserAuthOperations {
101126 forgotPassword : {
102127 email : string ;
@@ -115,13 +140,36 @@ export interface UserAuthOperations {
115140 password : string ;
116141 } ;
117142}
143+ /**
144+ * This interface was referenced by `Config`'s JSON-Schema
145+ * via the `definition` "admins".
146+ */
147+ export interface Admin {
148+ id : number ;
149+ updatedAt : string ;
150+ createdAt : string ;
151+ email : string ;
152+ resetPasswordToken ?: string | null ;
153+ resetPasswordExpiration ?: string | null ;
154+ salt ?: string | null ;
155+ hash ?: string | null ;
156+ loginAttempts ?: number | null ;
157+ lockUntil ?: string | null ;
158+ sessions ?:
159+ | {
160+ id : string ;
161+ createdAt ?: string | null ;
162+ expiresAt : string ;
163+ } [ ]
164+ | null ;
165+ password ?: string | null ;
166+ }
118167/**
119168 * This interface was referenced by `Config`'s JSON-Schema
120169 * via the `definition` "users".
121170 */
122171export interface User {
123172 id : number ;
124- role : 'admin' | 'user' ;
125173 updatedAt : string ;
126174 createdAt : string ;
127175 email : string ;
@@ -250,6 +298,10 @@ export interface Report {
250298export interface PayloadLockedDocument {
251299 id : number ;
252300 document ?:
301+ | ( {
302+ relationTo : 'admins' ;
303+ value : number | Admin ;
304+ } | null )
253305 | ( {
254306 relationTo : 'users' ;
255307 value : number | User ;
@@ -263,10 +315,15 @@ export interface PayloadLockedDocument {
263315 value : number | Report ;
264316 } | null ) ;
265317 globalSlug ?: string | null ;
266- user : {
267- relationTo : 'users' ;
268- value : number | User ;
269- } ;
318+ user :
319+ | {
320+ relationTo : 'admins' ;
321+ value : number | Admin ;
322+ }
323+ | {
324+ relationTo : 'users' ;
325+ value : number | User ;
326+ } ;
270327 updatedAt : string ;
271328 createdAt : string ;
272329}
@@ -276,10 +333,15 @@ export interface PayloadLockedDocument {
276333 */
277334export interface PayloadPreference {
278335 id : number ;
279- user : {
280- relationTo : 'users' ;
281- value : number | User ;
282- } ;
336+ user :
337+ | {
338+ relationTo : 'admins' ;
339+ value : number | Admin ;
340+ }
341+ | {
342+ relationTo : 'users' ;
343+ value : number | User ;
344+ } ;
283345 key ?: string | null ;
284346 value ?:
285347 | {
@@ -304,12 +366,33 @@ export interface PayloadMigration {
304366 updatedAt : string ;
305367 createdAt : string ;
306368}
369+ /**
370+ * This interface was referenced by `Config`'s JSON-Schema
371+ * via the `definition` "admins_select".
372+ */
373+ export interface AdminsSelect < T extends boolean = true > {
374+ updatedAt ?: T ;
375+ createdAt ?: T ;
376+ email ?: T ;
377+ resetPasswordToken ?: T ;
378+ resetPasswordExpiration ?: T ;
379+ salt ?: T ;
380+ hash ?: T ;
381+ loginAttempts ?: T ;
382+ lockUntil ?: T ;
383+ sessions ?:
384+ | T
385+ | {
386+ id ?: T ;
387+ createdAt ?: T ;
388+ expiresAt ?: T ;
389+ } ;
390+ }
307391/**
308392 * This interface was referenced by `Config`'s JSON-Schema
309393 * via the `definition` "users_select".
310394 */
311395export interface UsersSelect < T extends boolean = true > {
312- role ?: T ;
313396 updatedAt ?: T ;
314397 createdAt ?: T ;
315398 email ?: T ;
0 commit comments