1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-23 13:46:45 +02:00

chore: dora cleanup (#4676)

This PR adds: 
* Generated types for useProjectDoraMetrics
* Mobile enhancements
* Tooltips

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
This commit is contained in:
Fredrik Strand Oseberg 2023-09-13 15:50:42 +02:00 committed by GitHub
parent 99308a7054
commit 78273e4ff3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 681 additions and 212 deletions

View File

@ -14,7 +14,7 @@ import {
StyledTabContainer,
StyledTopRow,
} from './Project.styles';
import { Box, Paper, Tabs, Typography } from '@mui/material';
import { Box, Paper, Tabs, Typography, styled } from '@mui/material';
import { FileUpload } from '@mui/icons-material';
import useToast from 'hooks/useToast';
import useQueryParams from 'hooks/useQueryParams';
@ -40,6 +40,15 @@ import { EnterpriseBadge } from 'component/common/EnterpriseBadge/EnterpriseBadg
import { Badge } from 'component/common/Badge/Badge';
import { ProjectDoraMetrics } from './ProjectDoraMetrics/ProjectDoraMetrics';
const StyledBadge = styled(Badge)(({ theme }) => ({
position: 'absolute',
top: 5,
right: 20,
[theme.breakpoints.down('md')]: {
top: 2,
},
}));
export const Project = () => {
const projectId = useRequiredPathParam('projectId');
const params = useQueryParams();
@ -228,17 +237,9 @@ export const Project = () => {
<ConditionallyRender
condition={tab.new}
show={
<Badge
sx={{
position:
'absolute',
top: 10,
right: 20,
}}
color="success"
>
<StyledBadge color="success">
New
</Badge>
</StyledBadge>
}
/>
{(tab.isEnterprise &&

View File

@ -14,6 +14,18 @@ const StyledOuterContainer = styled(Box)(({ theme }) => ({
const StyledBtnContainer = styled(Box)(({ theme }) => ({
marginTop: theme.spacing(3),
[theme.breakpoints.down('md')]: {
display: 'flex',
flexDirection: 'column',
},
}));
const StyledBtn = styled(Button)(({ theme }) => ({
marginRight: theme.spacing(1),
[theme.breakpoints.down('md')]: {
marginRight: 0,
marginBottom: theme.spacing(1),
},
}));
const StyledDivider = styled(Divider)(({ theme }) => ({
@ -26,6 +38,10 @@ const StyledFlexBox = styled(Box)(({ theme }) => ({
alignItems: 'center',
marginTop: theme.spacing(1),
marginRight: theme.spacing(3),
[theme.breakpoints.down('sm')]: {
display: 'flex',
flexDirection: 'column',
},
}));
const StyledIconWrapper = styled(Box)(({ theme }) => ({
@ -73,7 +89,7 @@ export const ProjectDoraFeedback = () => {
}
};
const recipientEmail = 'recipient@example.com';
const recipientEmail = 'ux@getunleash.io';
const emailSubject = "I'd like to get involved";
const emailBody = `Hello Unleash,\n\nI just saw the new metrics page you are experimenting with in Unleash. I'd like to be involved in user tests and give my feedback on this feature.\n\nRegards,\n`;
@ -95,6 +111,22 @@ export const ProjectDoraFeedback = () => {
production.
</Typography>
<br />
<Typography>
DORA is a method for measuring the performance of your DevOps
teams. It measures four different metrics. You can read Google's
blog post about{' '}
<a
href="https://cloud.google.com/blog/products/devops-sre/using-the-four-keys-to-measure-your-devops-performance"
target="_blank"
rel="noopener noreferrer"
>
DORA metrics
</a>{' '}
for more information.
</Typography>
<ConditionallyRender
condition={!metrics.sent}
show={
@ -102,16 +134,13 @@ export const ProjectDoraFeedback = () => {
{' '}
<Typography>Is this useful to you?</Typography>
<StyledBtnContainer>
<Button
sx={theme => ({
marginRight: theme.spacing(1),
})}
<StyledBtn
variant="contained"
color="primary"
onClick={() => onBtnClick('useful')}
>
Yes, I like the direction
</Button>
</StyledBtn>
<Button
variant="outlined"
color="primary"

View File

@ -1,4 +1,4 @@
import { Box } from '@mui/material';
import { Box, Tooltip, useMediaQuery } from '@mui/material';
import { useProjectDoraMetrics } from 'hooks/api/getters/useProjectDoraMetrics/useProjectDoraMetrics';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { useMemo } from 'react';
@ -16,6 +16,8 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
import { PageHeader } from 'component/common/PageHeader/PageHeader';
import { Badge } from 'component/common/Badge/Badge';
import { ProjectDoraFeedback } from './ProjectDoraFeedback/ProjectDoraFeedback';
import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns';
import theme from 'themes/theme';
const resolveDoraMetrics = (input: number) => {
const ONE_MONTH = 30;
@ -81,15 +83,20 @@ export const ProjectDoraMetrics = () => {
},
{
Header: 'Time to production',
id: 'Time to production',
id: 'timetoproduction',
align: 'center',
Cell: ({ row: { original } }: any) => (
<Box
sx={{ display: 'flex', justifyContent: 'center' }}
data-loading
<Tooltip
title="The time from the feature toggle of type release was created until it was turned on in a production environment"
arrow
>
{original.timeToProduction} days
</Box>
<Box
sx={{ display: 'flex', justifyContent: 'center' }}
data-loading
>
{original.timeToProduction} days
</Box>
</Tooltip>
),
width: 200,
disableGlobalFilter: true,
@ -97,15 +104,24 @@ export const ProjectDoraMetrics = () => {
},
{
Header: `Deviation`,
id: 'Deviation from average',
id: 'deviation',
align: 'center',
Cell: ({ row: { original } }: any) => (
<Box
sx={{ display: 'flex', justifyContent: 'center' }}
data-loading
<Tooltip
title={`Deviation from project average. Average for this project is: ${
dora.projectAverage || 0
} days`}
arrow
>
{dora.projectAverage - original.timeToProduction} days
</Box>
<Box
sx={{ display: 'flex', justifyContent: 'center' }}
data-loading
>
{(dora.projectAverage ? dora.projectAverage : 0) -
original.timeToProduction}{' '}
days
</Box>
</Tooltip>
),
width: 300,
disableGlobalFilter: true,
@ -116,12 +132,17 @@ export const ProjectDoraMetrics = () => {
id: 'dora',
align: 'center',
Cell: ({ row: { original } }: any) => (
<Box
sx={{ display: 'flex', justifyContent: 'center' }}
data-loading
<Tooltip
title="Dora score. High = less than a week to production. Medium = less than a month to production. Low = Less than 6 months to production"
arrow
>
{resolveDoraMetrics(original.timeToProduction)}
</Box>
<Box
sx={{ display: 'flex', justifyContent: 'center' }}
data-loading
>
{resolveDoraMetrics(original.timeToProduction)}
</Box>
</Tooltip>
),
width: 200,
disableGlobalFilter: true,
@ -134,11 +155,12 @@ export const ProjectDoraMetrics = () => {
const initialState = useMemo(
() => ({
sortBy: [{ id: 'name', desc: false }],
hiddenColumns: ['description'],
}),
[]
);
const isExtraSmallScreen = useMediaQuery(theme.breakpoints.down('sm'));
const {
getTableProps,
getTableBodyProps,
@ -146,6 +168,7 @@ export const ProjectDoraMetrics = () => {
rows,
prepareRow,
state: { globalFilter },
setHiddenColumns,
} = useTable(
{
columns: columns as any[], // TODO: fix after `react-table` v8 update
@ -159,6 +182,17 @@ export const ProjectDoraMetrics = () => {
useSortBy
);
useConditionallyHiddenColumns(
[
{
condition: isExtraSmallScreen,
columns: ['deviation'],
},
],
setHiddenColumns,
columns
);
return (
<>
<ProjectDoraFeedback />

View File

@ -2,11 +2,19 @@ import useSWR, { mutate, SWRConfiguration } from 'swr';
import { useState, useEffect } from 'react';
import { formatApiPath } from 'utils/formatPath';
import handleErrorResponses from '../httpErrorResponseHandler';
import { ProjectDoraMetricsSchema } from 'openapi';
interface IUseProjectDoraMetricsOutput {
dora: ProjectDoraMetricsSchema;
loading: boolean;
error?: Error;
refetchDoraMetrics: () => void;
}
export const useProjectDoraMetrics = (
projectId: string,
options: SWRConfiguration = {}
) => {
): IUseProjectDoraMetricsOutput => {
const KEY = `api/admin/projects/${projectId}/dora`;
const path = formatApiPath(KEY);

View File

@ -16,7 +16,7 @@ export interface IEnvironments {
name: string;
enabled: boolean;
variantCount: number;
lastSeenAt: Date | null;
lastSeenAt?: string | null;
}
export interface IFeatureToggle {

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type AddRoleAccessToProject400 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type AddRoleAccessToProject401 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type AddRoleAccessToProject403 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type AddRoleAccessToProject404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type AddRoleAccessToProject415 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -8,7 +8,8 @@ import type { ChangeRequestCreateFeatureSchemaOneOfFour } from './changeRequestC
import type { ChangeRequestCreateFeatureSchemaOneOfSix } from './changeRequestCreateFeatureSchemaOneOfSix';
import type { ChangeRequestCreateFeatureSchemaOneOfEight } from './changeRequestCreateFeatureSchemaOneOfEight';
import type { ChangeRequestCreateFeatureSchemaOneOfOneone } from './changeRequestCreateFeatureSchemaOneOfOneone';
import type { ChangeRequestCreateFeatureSchemaOneOfOnefour } from './changeRequestCreateFeatureSchemaOneOfOnefour';
import type { ChangeRequestCreateFeatureSchemaOneOfOnethree } from './changeRequestCreateFeatureSchemaOneOfOnethree';
import type { ChangeRequestCreateFeatureSchemaOneOfOnesix } from './changeRequestCreateFeatureSchemaOneOfOnesix';
/**
* Data used to create a [change request](https://docs.getunleash.io/reference/change-requests) for a single feature change.
@ -34,7 +35,11 @@ export type ChangeRequestCreateFeatureSchema =
/** The name of the feature that this change applies to. */
feature: string;
})
| (ChangeRequestCreateFeatureSchemaOneOfOnefour & {
| (ChangeRequestCreateFeatureSchemaOneOfOnethree & {
/** The name of the feature that this change applies to. */
feature: string;
})
| (ChangeRequestCreateFeatureSchemaOneOfOnesix & {
/** The name of the feature that this change applies to. */
feature: string;
});

View File

@ -1,16 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
/**
* The name of this action.
*/
export type ChangeRequestCreateFeatureSchemaOneOfOnefourAction =
typeof ChangeRequestCreateFeatureSchemaOneOfOnefourAction[keyof typeof ChangeRequestCreateFeatureSchemaOneOfOnefourAction];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ChangeRequestCreateFeatureSchemaOneOfOnefourAction = {
reorderStrategy: 'reorderStrategy',
} as const;

View File

@ -4,13 +4,11 @@
* See `gen:api` script in package.json
*/
import type { ChangeRequestCreateFeatureSchemaOneOfOneoneAction } from './changeRequestCreateFeatureSchemaOneOfOneoneAction';
import type { ChangeRequestCreateFeatureSchemaOneOfOneonePayload } from './changeRequestCreateFeatureSchemaOneOfOneonePayload';
/**
* Update variants for this feature.
* Archive a feature.
*/
export type ChangeRequestCreateFeatureSchemaOneOfOneone = {
/** The name of this action. */
action: ChangeRequestCreateFeatureSchemaOneOfOneoneAction;
payload: ChangeRequestCreateFeatureSchemaOneOfOneonePayload;
};

View File

@ -12,5 +12,5 @@ export type ChangeRequestCreateFeatureSchemaOneOfOneoneAction =
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ChangeRequestCreateFeatureSchemaOneOfOneoneAction = {
patchVariant: 'patchVariant',
archiveFeature: 'archiveFeature',
} as const;

View File

@ -3,14 +3,14 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ChangeRequestCreateFeatureSchemaOneOfOnefourAction } from './changeRequestCreateFeatureSchemaOneOfOnefourAction';
import type { ChangeRequestCreateFeatureSchemaOneOfOnesixAction } from './changeRequestCreateFeatureSchemaOneOfOnesixAction';
import type { SetStrategySortOrderSchema } from './setStrategySortOrderSchema';
/**
* Reorder strategies for this feature
*/
export type ChangeRequestCreateFeatureSchemaOneOfOnefour = {
export type ChangeRequestCreateFeatureSchemaOneOfOnesix = {
/** The name of this action. */
action: ChangeRequestCreateFeatureSchemaOneOfOnefourAction;
action: ChangeRequestCreateFeatureSchemaOneOfOnesixAction;
payload: SetStrategySortOrderSchema;
};

View File

@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
/**
* The name of this action.
*/
export type ChangeRequestCreateFeatureSchemaOneOfOnesixAction =
typeof ChangeRequestCreateFeatureSchemaOneOfOnesixAction[keyof typeof ChangeRequestCreateFeatureSchemaOneOfOnesixAction];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ChangeRequestCreateFeatureSchemaOneOfOnesixAction = {
reorderStrategy: 'reorderStrategy',
} as const;

View File

@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ChangeRequestCreateFeatureSchemaOneOfOnethreeAction } from './changeRequestCreateFeatureSchemaOneOfOnethreeAction';
import type { ChangeRequestCreateFeatureSchemaOneOfOnethreePayload } from './changeRequestCreateFeatureSchemaOneOfOnethreePayload';
/**
* Update variants for this feature.
*/
export type ChangeRequestCreateFeatureSchemaOneOfOnethree = {
/** The name of this action. */
action: ChangeRequestCreateFeatureSchemaOneOfOnethreeAction;
payload: ChangeRequestCreateFeatureSchemaOneOfOnethreePayload;
};

View File

@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
/**
* The name of this action.
*/
export type ChangeRequestCreateFeatureSchemaOneOfOnethreeAction =
typeof ChangeRequestCreateFeatureSchemaOneOfOnethreeAction[keyof typeof ChangeRequestCreateFeatureSchemaOneOfOnethreeAction];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ChangeRequestCreateFeatureSchemaOneOfOnethreeAction = {
patchVariant: 'patchVariant',
} as const;

View File

@ -5,6 +5,6 @@
*/
import type { VariantSchema } from './variantSchema';
export type ChangeRequestCreateFeatureSchemaOneOfOneonePayload = {
export type ChangeRequestCreateFeatureSchemaOneOfOnethreePayload = {
variants: VariantSchema[];
};

View File

@ -4,27 +4,15 @@
* See `gen:api` script in package.json
*/
import type { CreateApiTokenSchemaOneOf } from './createApiTokenSchemaOneOf';
import type { CreateApiTokenSchemaOneOfTwo } from './createApiTokenSchemaOneOfTwo';
import type { CreateApiTokenSchemaOneOfThree } from './createApiTokenSchemaOneOfThree';
import type { CreateApiTokenSchemaOneOfFour } from './createApiTokenSchemaOneOfFour';
import type { CreateApiTokenSchemaOneOfSeven } from './createApiTokenSchemaOneOfSeven';
import type { CreateApiTokenSchemaOneOfOnezero } from './createApiTokenSchemaOneOfOnezero';
/**
* The data required to create an [Unleash API token](https://docs.getunleash.io/reference/api-tokens-and-client-keys).
*/
export type CreateApiTokenSchema =
| (CreateApiTokenSchemaOneOf & {
/** The time when this token should expire. */
expiresAt?: string;
})
| (CreateApiTokenSchemaOneOfFour & {
/** The time when this token should expire. */
expiresAt?: string;
})
| (CreateApiTokenSchemaOneOfSeven & {
/** The time when this token should expire. */
expiresAt?: string;
})
| (CreateApiTokenSchemaOneOfOnezero & {
/** The time when this token should expire. */
expiresAt?: string;
});
| CreateApiTokenSchemaOneOf
| CreateApiTokenSchemaOneOfTwo
| CreateApiTokenSchemaOneOfThree
| CreateApiTokenSchemaOneOfFour;

View File

@ -3,8 +3,12 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { CreateApiTokenSchemaOneOfAllOf } from './createApiTokenSchemaOneOfAllOf';
import type { CreateApiTokenSchemaOneOfAllOfTwo } from './createApiTokenSchemaOneOfAllOfTwo';
export type CreateApiTokenSchemaOneOf = CreateApiTokenSchemaOneOfAllOf &
CreateApiTokenSchemaOneOfAllOfTwo;
export type CreateApiTokenSchemaOneOf = {
/** The time when this token should expire. */
expiresAt?: string;
/** An admin token. Must be the string "admin" (not case sensitive). */
type: string;
/** The name of the token. */
tokenName: string;
};

View File

@ -1,10 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfAllOf = {
/** An admin token. Must be the string "admin" (not case sensitive). */
type: string;
};

View File

@ -1,10 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfAllOfTwo = {
/** The name of the token. */
tokenName: string;
};

View File

@ -3,8 +3,21 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { CreateApiTokenSchemaOneOfFourAllOf } from './createApiTokenSchemaOneOfFourAllOf';
import type { CreateApiTokenSchemaOneOfFourAllOfTwo } from './createApiTokenSchemaOneOfFourAllOfTwo';
export type CreateApiTokenSchemaOneOfFour = CreateApiTokenSchemaOneOfFourAllOf &
CreateApiTokenSchemaOneOfFourAllOfTwo;
export type CreateApiTokenSchemaOneOfFour = {
/** The time when this token should expire. */
expiresAt?: string;
/** A client or frontend token. Must be one of the strings "client" or "frontend" (not case sensitive). */
type: string;
/** The environment that the token should be valid for. Defaults to "default" */
environment?: string;
/** The project that the token should be valid for. Defaults to "*" meaning every project. This property is mutually incompatible with the `projects` property. If you specify one, you cannot specify the other. */
project?: string;
/** A list of projects that the token should be valid for. This property is mutually incompatible with the `project` property. If you specify one, you cannot specify the other. */
projects?: string[];
/**
* The name of the token. This property is deprecated. Use `tokenName` instead.
* @deprecated
*/
username: string;
};

View File

@ -1,10 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfFourAllOf = {
/** An admin token. Must be the string "admin" (not case sensitive). */
type: string;
};

View File

@ -1,11 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { CreateApiTokenSchemaOneOfOnezeroAllOf } from './createApiTokenSchemaOneOfOnezeroAllOf';
import type { CreateApiTokenSchemaOneOfOnezeroAllOfTwo } from './createApiTokenSchemaOneOfOnezeroAllOfTwo';
export type CreateApiTokenSchemaOneOfOnezero =
CreateApiTokenSchemaOneOfOnezeroAllOf &
CreateApiTokenSchemaOneOfOnezeroAllOfTwo;

View File

@ -1,13 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfOnezeroAllOfTwo = {
/**
* The name of the token. This property is deprecated. Use `tokenName` instead.
* @deprecated
*/
username: string;
};

View File

@ -1,11 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { CreateApiTokenSchemaOneOfSevenAllOf } from './createApiTokenSchemaOneOfSevenAllOf';
import type { CreateApiTokenSchemaOneOfSevenAllOfTwo } from './createApiTokenSchemaOneOfSevenAllOfTwo';
export type CreateApiTokenSchemaOneOfSeven =
CreateApiTokenSchemaOneOfSevenAllOf &
CreateApiTokenSchemaOneOfSevenAllOfTwo;

View File

@ -1,16 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfSevenAllOf = {
/** A client or frontend token. Must be one of the strings "client" or "frontend" (not case sensitive). */
type: string;
/** The environment that the token should be valid for. Defaults to "default" */
environment?: string;
/** The project that the token should be valid for. Defaults to "*" meaning every project. This property is mutually incompatible with the `projects` property. If you specify one, you cannot specify the other. */
project?: string;
/** A list of projects that the token should be valid for. This property is mutually incompatible with the `project` property. If you specify one, you cannot specify the other. */
projects?: string[];
};

View File

@ -1,10 +0,0 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfSevenAllOfTwo = {
/** The name of the token. */
tokenName: string;
};

View File

@ -4,7 +4,9 @@
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfOnezeroAllOf = {
export type CreateApiTokenSchemaOneOfThree = {
/** The time when this token should expire. */
expiresAt?: string;
/** A client or frontend token. Must be one of the strings "client" or "frontend" (not case sensitive). */
type: string;
/** The environment that the token should be valid for. Defaults to "default" */
@ -13,4 +15,6 @@ export type CreateApiTokenSchemaOneOfOnezeroAllOf = {
project?: string;
/** A list of projects that the token should be valid for. This property is mutually incompatible with the `project` property. If you specify one, you cannot specify the other. */
projects?: string[];
/** The name of the token. */
tokenName: string;
};

View File

@ -4,7 +4,11 @@
* See `gen:api` script in package.json
*/
export type CreateApiTokenSchemaOneOfFourAllOfTwo = {
export type CreateApiTokenSchemaOneOfTwo = {
/** The time when this token should expire. */
expiresAt?: string;
/** An admin token. Must be the string "admin" (not case sensitive). */
type: string;
/**
* The name of the token. This property is deprecated. Use `tokenName` instead.
* @deprecated

View File

@ -0,0 +1,17 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
/**
* Create a feature naming pattern
*/
export interface CreateFeatureNamingPatternSchema {
/** A JavaScript regular expression pattern, without the start and end delimiters. Optional flags are not allowed. */
pattern: string | null;
/** An example of a feature name that matches the pattern. Must itself match the pattern supplied. */
example?: string | null;
/** A description of the pattern in a human-readable format. Will be shown to users when they create a new feature flag. */
description?: string | null;
}

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type CreateProjectApiToken404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -11,8 +11,14 @@ import type { CreateStrategySchemaParametersItem } from './createStrategySchemaP
export interface CreateStrategySchema {
/** The name of the strategy type. Must be unique. */
name: string;
/** The title of the strategy */
title?: string;
/** A description of the strategy type. */
description?: string;
/** Whether the strategy type is editable or not. Defaults to `true`. */
editable?: boolean;
/** Whether the strategy type is deprecated or not. Defaults to `false`. */
deprecated?: boolean;
/** The parameter list lets you pass arguments to your custom activation strategy. These will be made available to your custom strategy implementation. */
parameters: CreateStrategySchemaParametersItem[];
}

View File

@ -9,7 +9,7 @@ import type { CreateStrategyVariantSchemaPayloadType } from './createStrategyVar
* Extra data configured for this variant
*/
export type CreateStrategyVariantSchemaPayload = {
/** The type of the value. Commonly used types are string, json and csv. */
/** The type of the value. Commonly used types are string, number, json and csv. */
type: CreateStrategyVariantSchemaPayloadType;
/** The actual value of payload */
value: string;

View File

@ -5,7 +5,7 @@
*/
/**
* The type of the value. Commonly used types are string, json and csv.
* The type of the value. Commonly used types are string, number, json and csv.
*/
export type CreateStrategyVariantSchemaPayloadType =
typeof CreateStrategyVariantSchemaPayloadType[keyof typeof CreateStrategyVariantSchemaPayloadType];
@ -15,4 +15,5 @@ export const CreateStrategyVariantSchemaPayloadType = {
json: 'json',
csv: 'csv',
string: 'string',
number: 'number',
} as const;

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type DeleteProjectApiToken400 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type DeleteProjectApiToken404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,15 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
/**
* The representation of a dora time to production feature metric
*/
export interface DoraFeaturesSchema {
/** The name of a feature toggle */
name: string;
/** The average number of days it takes a feature toggle to get into production */
timeToProduction: number;
}

View File

@ -48,6 +48,10 @@ export const EventSchemaType = {
'context-field-updated': 'context-field-updated',
'context-field-deleted': 'context-field-deleted',
'project-access-added': 'project-access-added',
'project-access-user-roles-updated': 'project-access-user-roles-updated',
'project-access-group-roles-updated': 'project-access-group-roles-updated',
'project-access-user-roles-deleted': 'project-access-user-roles-deleted',
'project-access-group-roles-deleted': 'project-access-group-roles-deleted',
'project-created': 'project-created',
'project-updated': 'project-updated',
'project-deleted': 'project-deleted',

View File

@ -28,4 +28,6 @@ export interface FeatureEnvironmentSchema {
strategies?: FeatureStrategySchema[];
/** A list of variants for the feature environment */
variants?: VariantSchema[];
/** The date when metrics where last collected for the feature environment */
lastSeenAt?: string | null;
}

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type GetProjectDora401 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type GetProjectDora403 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type GetProjectDora404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -17,6 +17,8 @@ export interface GroupWithProjectRoleSchema {
addedAt?: string;
/** The ID of the role this group has in the given project */
roleId?: number;
/** A list of roles this user has in the given project */
roles?: number[];
/** A custom description of the group */
description?: string | null;
/** A list of SSO groups that should map to this Unleash group */

View File

@ -7,6 +7,7 @@ import type { HealthOverviewSchemaMode } from './healthOverviewSchemaMode';
import type { ProjectEnvironmentSchema } from './projectEnvironmentSchema';
import type { FeatureSchema } from './featureSchema';
import type { ProjectStatsSchema } from './projectStatsSchema';
import type { CreateFeatureNamingPatternSchema } from './createFeatureNamingPatternSchema';
/**
* An overview of a project's stats and its health as described in the documentation on [technical debt](https://docs.getunleash.io/reference/technical-debt)
@ -40,4 +41,5 @@ export interface HealthOverviewSchema {
favorite?: boolean;
/** Project statistics */
stats?: ProjectStatsSchema;
featureNaming?: CreateFeatureNamingPatternSchema;
}

View File

@ -7,6 +7,7 @@ import type { HealthReportSchemaMode } from './healthReportSchemaMode';
import type { ProjectEnvironmentSchema } from './projectEnvironmentSchema';
import type { FeatureSchema } from './featureSchema';
import type { ProjectStatsSchema } from './projectStatsSchema';
import type { CreateFeatureNamingPatternSchema } from './createFeatureNamingPatternSchema';
/**
* A report of the current health of the requested project, with datapoints like counters of currently active, stale, and potentially stale feature toggles.
@ -40,6 +41,7 @@ export interface HealthReportSchema {
favorite?: boolean;
/** Project statistics */
stats?: ProjectStatsSchema;
featureNaming?: CreateFeatureNamingPatternSchema;
/** The number of potentially stale feature toggles. */
potentiallyStaleCount: number;
/** The number of active feature toggles. */

View File

@ -24,6 +24,11 @@ export * from './addFeatureStrategy403';
export * from './addFeatureStrategy404';
export * from './addPublicSignupTokenUser400';
export * from './addPublicSignupTokenUser409';
export * from './addRoleAccessToProject400';
export * from './addRoleAccessToProject401';
export * from './addRoleAccessToProject403';
export * from './addRoleAccessToProject404';
export * from './addRoleAccessToProject415';
export * from './addRoleToUser401';
export * from './addRoleToUser403';
export * from './addRoleToUser404';
@ -127,11 +132,13 @@ export * from './changeRequestCreateFeatureSchemaOneOfEightAction';
export * from './changeRequestCreateFeatureSchemaOneOfEightPayload';
export * from './changeRequestCreateFeatureSchemaOneOfFour';
export * from './changeRequestCreateFeatureSchemaOneOfFourAction';
export * from './changeRequestCreateFeatureSchemaOneOfOnefour';
export * from './changeRequestCreateFeatureSchemaOneOfOnefourAction';
export * from './changeRequestCreateFeatureSchemaOneOfOneone';
export * from './changeRequestCreateFeatureSchemaOneOfOneoneAction';
export * from './changeRequestCreateFeatureSchemaOneOfOneonePayload';
export * from './changeRequestCreateFeatureSchemaOneOfOnesix';
export * from './changeRequestCreateFeatureSchemaOneOfOnesixAction';
export * from './changeRequestCreateFeatureSchemaOneOfOnethree';
export * from './changeRequestCreateFeatureSchemaOneOfOnethreeAction';
export * from './changeRequestCreateFeatureSchemaOneOfOnethreePayload';
export * from './changeRequestCreateFeatureSchemaOneOfPayload';
export * from './changeRequestCreateFeatureSchemaOneOfSix';
export * from './changeRequestCreateFeatureSchemaOneOfSixAction';
@ -203,17 +210,9 @@ export * from './createApiToken403';
export * from './createApiToken415';
export * from './createApiTokenSchema';
export * from './createApiTokenSchemaOneOf';
export * from './createApiTokenSchemaOneOfAllOf';
export * from './createApiTokenSchemaOneOfAllOfTwo';
export * from './createApiTokenSchemaOneOfFour';
export * from './createApiTokenSchemaOneOfFourAllOf';
export * from './createApiTokenSchemaOneOfFourAllOfTwo';
export * from './createApiTokenSchemaOneOfOnezero';
export * from './createApiTokenSchemaOneOfOnezeroAllOf';
export * from './createApiTokenSchemaOneOfOnezeroAllOfTwo';
export * from './createApiTokenSchemaOneOfSeven';
export * from './createApiTokenSchemaOneOfSevenAllOf';
export * from './createApiTokenSchemaOneOfSevenAllOfTwo';
export * from './createApiTokenSchemaOneOfThree';
export * from './createApiTokenSchemaOneOfTwo';
export * from './createApplication400';
export * from './createApplication401';
export * from './createApplication403';
@ -226,6 +225,7 @@ export * from './createFeature401';
export * from './createFeature403';
export * from './createFeature404';
export * from './createFeature415';
export * from './createFeatureNamingPatternSchema';
export * from './createFeatureSchema';
export * from './createFeatureStrategySchema';
export * from './createFeedback400';
@ -249,6 +249,7 @@ export * from './createProject415';
export * from './createProjectApiToken400';
export * from './createProjectApiToken401';
export * from './createProjectApiToken403';
export * from './createProjectApiToken404';
export * from './createProjectSchema';
export * from './createProjectSchemaMode';
export * from './createPublicSignupToken400';
@ -330,8 +331,10 @@ export * from './deletePat404';
export * from './deleteProject400';
export * from './deleteProject401';
export * from './deleteProject403';
export * from './deleteProjectApiToken400';
export * from './deleteProjectApiToken401';
export * from './deleteProjectApiToken403';
export * from './deleteProjectApiToken404';
export * from './deleteRole400';
export * from './deleteRole401';
export * from './deleteRole403';
@ -350,6 +353,7 @@ export * from './deleteUser404';
export * from './deprecateStrategy401';
export * from './deprecateStrategy403';
export * from './deprecateStrategy404';
export * from './doraFeaturesSchema';
export * from './edgeTokenSchema';
export * from './edgeTokenSchemaType';
export * from './editChange404';
@ -473,6 +477,9 @@ export * from './getProjectAccess403';
export * from './getProjectApiTokens401';
export * from './getProjectApiTokens403';
export * from './getProjectApiTokens404';
export * from './getProjectDora401';
export * from './getProjectDora403';
export * from './getProjectDora404';
export * from './getProjectEnvironments401';
export * from './getProjectEnvironments403';
export * from './getProjectEnvironments404';
@ -636,10 +643,12 @@ export * from './playgroundStrategySchemaResultAnyOfFourVariantPayloadType';
export * from './profileSchema';
export * from './projectAccessSchema';
export * from './projectAddAccessSchema';
export * from './projectAddAccessSchemaGroupsItem';
export * from './projectAddAccessSchemaUsersItem';
export * from './projectAddRoleAccessSchema';
export * from './projectAddRoleAccessSchemaGroupsItem';
export * from './projectAddRoleAccessSchemaUsersItem';
export * from './projectCreatedSchema';
export * from './projectCreatedSchemaMode';
export * from './projectDoraMetricsSchema';
export * from './projectEnvironmentSchema';
export * from './projectOverviewSchema';
export * from './projectOverviewSchemaMode';
@ -684,6 +693,9 @@ export * from './removeFavoriteFeature401';
export * from './removeFavoriteFeature404';
export * from './removeFavoriteProject401';
export * from './removeFavoriteProject404';
export * from './removeGroupAccess401';
export * from './removeGroupAccess403';
export * from './removeGroupAccess404';
export * from './removeRoleForUser401';
export * from './removeRoleForUser403';
export * from './removeRoleForUser404';
@ -699,6 +711,9 @@ export * from './removeStrategy404';
export * from './removeTag401';
export * from './removeTag403';
export * from './removeTag404';
export * from './removeUserAccess401';
export * from './removeUserAccess403';
export * from './removeUserAccess404';
export * from './requestsPerSecondSchema';
export * from './requestsPerSecondSchemaData';
export * from './requestsPerSecondSchemaDataResultItem';
@ -745,6 +760,12 @@ export * from './setOidcSettings400';
export * from './setOidcSettings401';
export * from './setOidcSettings403';
export * from './setOidcSettings415';
export * from './setRolesForGroup401';
export * from './setRolesForGroup403';
export * from './setRolesForGroup404';
export * from './setRolesForUser401';
export * from './setRolesForUser403';
export * from './setRolesForUser404';
export * from './setSamlSettings400';
export * from './setSamlSettings401';
export * from './setSamlSettings403';

View File

@ -15,4 +15,5 @@ export const PlaygroundStrategySchemaResultAnyOfFourVariantPayloadType = {
json: 'json',
csv: 'csv',
string: 'string',
number: 'number',
} as const;

View File

@ -3,15 +3,15 @@
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ProjectAddAccessSchemaGroupsItem } from './projectAddAccessSchemaGroupsItem';
import type { ProjectAddAccessSchemaUsersItem } from './projectAddAccessSchemaUsersItem';
/**
* An object containing a collection of users and a collection of groups.
* An object containing a collection of roles, a collection of groups and a collection of users.
*/
export interface ProjectAddAccessSchema {
/** A list of groups IDs */
groups: ProjectAddAccessSchemaGroupsItem[];
/** A list of role IDs */
roles: number[];
/** A list of group IDs */
groups: number[];
/** A list of user IDs */
users: ProjectAddAccessSchemaUsersItem[];
users: number[];
}

View File

@ -0,0 +1,17 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { ProjectAddRoleAccessSchemaGroupsItem } from './projectAddRoleAccessSchemaGroupsItem';
import type { ProjectAddRoleAccessSchemaUsersItem } from './projectAddRoleAccessSchemaUsersItem';
/**
* An object containing a collection of users and a collection of groups.
*/
export interface ProjectAddRoleAccessSchema {
/** A list of groups IDs */
groups: ProjectAddRoleAccessSchemaGroupsItem[];
/** A list of user IDs */
users: ProjectAddRoleAccessSchemaUsersItem[];
}

View File

@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
export type ProjectAddAccessSchemaGroupsItem = {
export type ProjectAddRoleAccessSchemaGroupsItem = {
/** A group ID */
id: number;
};

View File

@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
export type ProjectAddAccessSchemaUsersItem = {
export type ProjectAddRoleAccessSchemaUsersItem = {
/** A user ID */
id: number;
};

View File

@ -0,0 +1,16 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
import type { DoraFeaturesSchema } from './doraFeaturesSchema';
/**
* A projects dora metrics
*/
export interface ProjectDoraMetricsSchema {
/** The average time it takes a feature toggle to be enabled in production. The measurement unit is days. */
projectAverage?: number;
/** An array of objects containing feature toggle name and timeToProduction values. The measurement unit of timeToProduction is days. */
features: DoraFeaturesSchema[];
}

View File

@ -5,6 +5,7 @@
*/
import type { ProjectStatsSchema } from './projectStatsSchema';
import type { ProjectOverviewSchemaMode } from './projectOverviewSchemaMode';
import type { CreateFeatureNamingPatternSchema } from './createFeatureNamingPatternSchema';
import type { ProjectEnvironmentSchema } from './projectEnvironmentSchema';
import type { FeatureSchema } from './featureSchema';
@ -26,6 +27,7 @@ export interface ProjectOverviewSchema {
mode?: ProjectOverviewSchemaMode;
/** A limit on the number of features allowed in the project. Null if no limit. */
featureLimit?: number | null;
featureNaming?: CreateFeatureNamingPatternSchema;
/** The number of members this project has */
members?: number;
/** An indicator of the [project's health](https://docs.getunleash.io/reference/technical-debt#health-rating) on a scale from 0 to 100 */

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RemoveGroupAccess401 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RemoveGroupAccess403 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RemoveGroupAccess404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RemoveUserAccess401 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RemoveUserAccess403 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type RemoveUserAccess404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -48,6 +48,10 @@ export const SearchEventsSchemaType = {
'context-field-updated': 'context-field-updated',
'context-field-deleted': 'context-field-deleted',
'project-access-added': 'project-access-added',
'project-access-user-roles-updated': 'project-access-user-roles-updated',
'project-access-group-roles-updated': 'project-access-group-roles-updated',
'project-access-user-roles-deleted': 'project-access-user-roles-deleted',
'project-access-group-roles-deleted': 'project-access-group-roles-deleted',
'project-created': 'project-created',
'project-updated': 'project-updated',
'project-deleted': 'project-deleted',

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type SetRolesForGroup401 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type SetRolesForGroup403 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type SetRolesForGroup404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type SetRolesForUser401 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type SetRolesForUser403 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -0,0 +1,14 @@
/**
* Generated by Orval
* Do not edit manually.
* See `gen:api` script in package.json
*/
export type SetRolesForUser404 = {
/** The ID of the error instance */
id?: string;
/** The name of the error kind */
name?: string;
/** A description of what went wrong. */
message?: string;
};

View File

@ -9,7 +9,7 @@ import type { StrategyVariantSchemaPayloadType } from './strategyVariantSchemaPa
* Extra data configured for this variant
*/
export type StrategyVariantSchemaPayload = {
/** The type of the value. Commonly used types are string, json and csv. */
/** The type of the value. Commonly used types are string, number, json and csv. */
type: StrategyVariantSchemaPayloadType;
/** The actual value of payload */
value: string;

View File

@ -5,7 +5,7 @@
*/
/**
* The type of the value. Commonly used types are string, json and csv.
* The type of the value. Commonly used types are string, number, json and csv.
*/
export type StrategyVariantSchemaPayloadType =
typeof StrategyVariantSchemaPayloadType[keyof typeof StrategyVariantSchemaPayloadType];
@ -15,4 +15,5 @@ export const StrategyVariantSchemaPayloadType = {
json: 'json',
csv: 'csv',
string: 'string',
number: 'number',
} as const;

View File

@ -25,4 +25,6 @@ export interface UserWithProjectRoleSchema {
addedAt?: string;
/** The ID of the role this user has in the given project */
roleId?: number;
/** A list of roles this user has in the given project */
roles?: number[];
}

View File

@ -10,4 +10,6 @@
export interface ValidateFeatureSchema {
/** The feature name to validate. */
name: string;
/** The id of the project that the feature flag will belong to. If the target project has a feature naming pattern defined, the name will be validated against that pattern. */
projectId?: string | null;
}

View File

@ -9,7 +9,7 @@ import type { VariantSchemaPayloadType } from './variantSchemaPayloadType';
* Extra data configured for this variant
*/
export type VariantSchemaPayload = {
/** The type of the value. Commonly used types are string, json and csv. */
/** The type of the value. Commonly used types are string, number, json and csv. */
type: VariantSchemaPayloadType;
/** The actual value of payload */
value: string;

View File

@ -5,7 +5,7 @@
*/
/**
* The type of the value. Commonly used types are string, json and csv.
* The type of the value. Commonly used types are string, number, json and csv.
*/
export type VariantSchemaPayloadType =
typeof VariantSchemaPayloadType[keyof typeof VariantSchemaPayloadType];
@ -15,4 +15,5 @@ export const VariantSchemaPayloadType = {
json: 'json',
csv: 'csv',
string: 'string',
number: 'number',
} as const;