1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src/lib/openapi/spec/public-signup-tokens-schema.ts
andreas-unleash 193c12acd8
chore: docs for public signup token tag (#3486)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #
[1-863](https://linear.app/unleash/issue/1-836/update-endpoints-for-tag-public-signup-tokens)

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2023-04-21 11:26:54 +00:00

50 lines
1.6 KiB
TypeScript

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',
description: 'A wrapper object containing all the public signup tokens',
additionalProperties: false,
required: ['tokens'],
properties: {
tokens: {
type: 'array',
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',
},
},
],
items: {
$ref: '#/components/schemas/publicSignupTokenSchema',
},
},
},
components: {
schemas: {
publicSignupTokenSchema,
userSchema,
roleSchema,
},
},
} as const;
export type PublicSignupTokensSchema = FromSchema<
typeof publicSignupTokensSchema
>;