2022-06-22 14:55:43 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
import { userSchema } from './user-schema';
|
|
|
|
import { roleSchema } from './role-schema';
|
|
|
|
|
|
|
|
export const usersSchema = {
|
|
|
|
$id: '#/components/schemas/usersSchema',
|
|
|
|
type: 'object',
|
|
|
|
additionalProperties: false,
|
2023-07-06 08:24:46 +02:00
|
|
|
description: 'Users and root roles',
|
2022-06-22 14:55:43 +02:00
|
|
|
required: ['users'],
|
|
|
|
properties: {
|
|
|
|
users: {
|
|
|
|
type: 'array',
|
2023-07-06 08:24:46 +02:00
|
|
|
description: 'A list of users in the Unleash instance.',
|
2022-06-22 14:55:43 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/userSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
rootRoles: {
|
|
|
|
type: 'array',
|
2023-07-06 08:24:46 +02:00
|
|
|
description:
|
2023-08-10 09:21:58 +02:00
|
|
|
'A list of [root roles](https://docs.getunleash.io/reference/rbac#predefined-roles) in the Unleash instance.',
|
2022-06-22 14:55:43 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/roleSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
userSchema,
|
|
|
|
roleSchema,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type UsersSchema = FromSchema<typeof usersSchema>;
|