2023-01-11 16:00:20 +01:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
|
2023-09-18 15:43:01 +02:00
|
|
|
const commonProps = {
|
|
|
|
environment: {
|
|
|
|
type: 'string',
|
|
|
|
example: 'development',
|
|
|
|
description: 'The environment to export from',
|
|
|
|
},
|
|
|
|
downloadFile: {
|
|
|
|
type: 'boolean',
|
|
|
|
example: true,
|
|
|
|
description: 'Whether to return a downloadable file',
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
2023-01-11 16:00:20 +01:00
|
|
|
export const exportQuerySchema = {
|
|
|
|
$id: '#/components/schemas/exportQuerySchema',
|
|
|
|
type: 'object',
|
2023-07-04 16:41:16 +02:00
|
|
|
description:
|
|
|
|
'Available query parameters for the [deprecated export/import](https://docs.getunleash.io/reference/deploy/import-export) functionality.',
|
2023-12-19 08:57:10 +01:00
|
|
|
anyOf: [
|
2023-04-27 10:22:14 +02:00
|
|
|
{
|
2023-09-18 15:43:01 +02:00
|
|
|
required: ['environment', 'features'],
|
2023-04-27 10:22:14 +02:00
|
|
|
properties: {
|
2023-09-18 15:43:01 +02:00
|
|
|
...commonProps,
|
2023-04-27 10:22:14 +02:00
|
|
|
features: {
|
|
|
|
type: 'array',
|
2023-07-04 16:41:16 +02:00
|
|
|
example: ['MyAwesomeFeature'],
|
2023-04-27 10:22:14 +02:00
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
minLength: 1,
|
|
|
|
},
|
2023-12-19 08:57:10 +01:00
|
|
|
description:
|
|
|
|
'Selects features to export by name. If the list is empty all features are returned.',
|
2023-04-27 10:22:14 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-09-18 15:43:01 +02:00
|
|
|
required: ['environment', 'tag'],
|
2023-04-27 10:22:14 +02:00
|
|
|
properties: {
|
2023-09-18 15:43:01 +02:00
|
|
|
...commonProps,
|
2023-04-27 10:22:14 +02:00
|
|
|
tag: {
|
|
|
|
type: 'string',
|
2023-07-04 16:41:16 +02:00
|
|
|
example: 'release',
|
2023-12-19 08:57:10 +01:00
|
|
|
description: 'Selects features to export by tag.',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
required: ['environment', 'project'],
|
|
|
|
properties: {
|
|
|
|
...commonProps,
|
|
|
|
project: {
|
|
|
|
type: 'string',
|
|
|
|
example: 'my-project',
|
2023-04-27 10:22:14 +02:00
|
|
|
description:
|
2023-12-19 08:57:10 +01:00
|
|
|
'Selects project to export the features from. Used when no tags or features are provided.',
|
2023-04-27 10:22:14 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2023-01-11 16:00:20 +01:00
|
|
|
components: {
|
|
|
|
schemas: {},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type ExportQuerySchema = FromSchema<typeof exportQuerySchema>;
|