2023-07-06 08:24:46 +02:00
import { FromSchema } from 'json-schema-to-ts' ;
import { userSchema } from './user-schema' ;
export const createUserResponseSchema = {
$id : '#/components/schemas/createUserResponseSchema' ,
type : 'object' ,
additionalProperties : false ,
description : 'An Unleash user after creation' ,
required : [ 'id' ] ,
properties : {
. . . userSchema . properties ,
rootRole : {
description :
2023-08-10 09:21:58 +02:00
'Which [root role](https://docs.getunleash.io/reference/rbac#predefined-roles) this user is assigned. Usually a numeric role ID, but can be a string when returning newly created user with an explicit string role.' ,
2023-07-06 08:24:46 +02:00
oneOf : [
{
type : 'integer' ,
example : 1 ,
minimum : 0 ,
} ,
{
type : 'string' ,
example : 'Admin' ,
enum : [ 'Admin' , 'Editor' , 'Viewer' , 'Owner' , 'Member' ] ,
} ,
] ,
} ,
} ,
components : { } ,
} as const ;
export type CreateUserResponseSchema = FromSchema <
typeof createUserResponseSchema
> ;