2022-09-14 14:29:12 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
import { userSchema } from './user-schema';
|
|
|
|
import { roleSchema } from './role-schema';
|
|
|
|
|
|
|
|
export const publicSignupTokenSchema = {
|
|
|
|
$id: '#/components/schemas/publicSignupTokenSchema',
|
|
|
|
type: 'object',
|
|
|
|
additionalProperties: false,
|
2022-09-26 12:06:30 +02:00
|
|
|
required: [
|
|
|
|
'secret',
|
|
|
|
'url',
|
|
|
|
'name',
|
|
|
|
'expiresAt',
|
|
|
|
'createdAt',
|
|
|
|
'createdBy',
|
2022-09-30 13:01:32 +02:00
|
|
|
'enabled',
|
2022-09-26 12:06:30 +02:00
|
|
|
'role',
|
|
|
|
],
|
2022-09-14 14:29:12 +02:00
|
|
|
properties: {
|
|
|
|
secret: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2022-09-26 12:06:30 +02:00
|
|
|
url: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2022-09-14 14:29:12 +02:00
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
2022-09-30 13:01:32 +02:00
|
|
|
enabled: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
2022-09-14 14:29:12 +02:00
|
|
|
expiresAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
},
|
|
|
|
createdAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
},
|
|
|
|
createdBy: {
|
|
|
|
type: 'string',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
users: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/userSchema',
|
|
|
|
},
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
role: {
|
|
|
|
$ref: '#/components/schemas/roleSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
userSchema,
|
|
|
|
roleSchema,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type PublicSignupTokenSchema = FromSchema<
|
|
|
|
typeof publicSignupTokenSchema
|
|
|
|
>;
|