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';
|
|
|
|
import { publicSignupTokenSchema } from './public-signup-token-schema';
|
|
|
|
|
|
|
|
export const publicSignupTokensSchema = {
|
|
|
|
$id: '#/components/schemas/publicSignupTokensSchema',
|
|
|
|
type: 'object',
|
2023-04-21 13:26:54 +02:00
|
|
|
description: 'A wrapper object containing all the public signup tokens',
|
2022-09-14 14:29:12 +02:00
|
|
|
additionalProperties: false,
|
|
|
|
required: ['tokens'],
|
|
|
|
properties: {
|
|
|
|
tokens: {
|
|
|
|
type: 'array',
|
2023-04-21 13:26:54 +02:00
|
|
|
description: 'An array of all the public signup tokens',
|
|
|
|
example: [
|
|
|
|
{
|
|
|
|
secret: 'a3c84b25409ea8ca1782ef17f94a42fc',
|
|
|
|
url: 'https://my_unleash_instance/new-user?invite=a3c84b25409ea8ca1782ef17f94a42fc',
|
|
|
|
name: 'Invite public viewers',
|
|
|
|
enabled: false,
|
|
|
|
expiresAt: '2023-04-12T11:13:31.960Z',
|
|
|
|
createdAt: '2023-04-12T11:13:31.960Z',
|
|
|
|
createdBy: 'someone',
|
|
|
|
users: null,
|
|
|
|
role: {
|
|
|
|
id: 3,
|
|
|
|
type: 'root',
|
|
|
|
name: 'Viewer',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2022-09-14 14:29:12 +02:00
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/publicSignupTokenSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
publicSignupTokenSchema,
|
|
|
|
userSchema,
|
|
|
|
roleSchema,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type PublicSignupTokensSchema = FromSchema<
|
|
|
|
typeof publicSignupTokensSchema
|
|
|
|
>;
|