1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00

Orval generator POC (#2724)

for #2715
This commit is contained in:
Tymoteusz Czech 2023-01-05 11:57:53 +01:00 committed by GitHub
parent 58dd09f3e1
commit 1653b0449a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
305 changed files with 5505 additions and 4770 deletions

View File

@ -1,3 +1,2 @@
.github/*
/src/openapi
CHANGELOG.md

37
frontend/orval.config.js Normal file
View File

@ -0,0 +1,37 @@
/**
* How to generate OpenAPI client
*
* For now we only use generated types (src/openapi/models).
* We will use methods (src/openapi/apis) for new features soon.
* 1. `yarn gen:api` to generate the client
* 2. `rm -rf src/openapi/apis` to remove methods (! except if you want to use some of those)
* 3. clean up `src/openapi/index.ts` imports
*/
module.exports = {
unleashApi: {
output: {
mode: 'tags',
workspace: 'src/openapi',
target: 'apis',
schemas: 'models',
client: 'swr',
prettier: true,
clean: true,
// mock: true,
override: {
mutator: {
path: './fetcher.ts',
name: 'fetcher',
},
},
},
input: {
target:
process.env.UNLEASH_OPENAPI_URL ||
'http://localhost:4242/docs/openapi.json',
},
hooks: {
afterAllFilesWrite: 'yarn fmt',
},
},
};

View File

@ -26,6 +26,8 @@
"ts:check": "tsc",
"e2e": "yarn run cypress open --config baseUrl='http://localhost:3000' --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all",
"e2e:heroku": "yarn run cypress open --config baseUrl='https://unleash.herokuapp.com' --env AUTH_USER=admin,AUTH_PASSWORD=unleash4all",
"gen:api": "orval --config orval.config.js",
"gen:api:demo": "UNLEASH_OPENAPI_URL=https://app.unleash-hosted.com/demo/docs/openapi.json yarn run gen:api",
"prepare": "yarn run build"
},
"devDependencies": {
@ -35,7 +37,6 @@
"@mui/icons-material": "5.10.15",
"@mui/lab": "5.0.0-alpha.109",
"@mui/material": "5.10.15",
"@openapitools/openapi-generator-cli": "2.5.2",
"@testing-library/dom": "8.19.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
@ -93,7 +94,7 @@
"react-timeago": "7.1.0",
"sass": "1.57.1",
"semver": "7.3.8",
"swr": "1.3.0",
"swr": "2.0.0",
"tss-react": "4.0.0",
"typescript": "4.8.4",
"vite": "4.0.4",
@ -103,6 +104,9 @@
"vitest": "0.26.3",
"whatwg-fetch": "3.6.2"
},
"optionalDependencies": {
"orval": "^6.10.3"
},
"resolutions": {
"@codemirror/state": "6.2.0",
"@xmldom/xmldom": "^0.8.4"

View File

@ -1,24 +0,0 @@
#!/bin/sh
# Generate OpenAPI bindings for the Unleash API.
# https://openapi-generator.tech/docs/generators/typescript-fetch
set -feux
cd "$(dirname "$0")"
# URL to the generated open API spec.
# Set the UNLEASH_OPENAPI_URL environment variable to override.
UNLEASH_OPENAPI_URL="${UNLEASH_OPENAPI_URL:-http://localhost:4242/docs/openapi.json}"
rm -rf "../src/openapi"
mkdir "../src/openapi"
npx @openapitools/openapi-generator-cli generate \
-g "typescript-fetch" \
-i "$UNLEASH_OPENAPI_URL" \
-o "../src/openapi"
# Remove unused files.
rm "openapitools.json"
rm "../src/openapi/.openapi-generator-ignore"
rm -r "../src/openapi/.openapi-generator"

View File

@ -1,7 +1,8 @@
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
import { useFeaturesArchive } from 'hooks/api/getters/useFeaturesArchive/useFeaturesArchive';
import { VFC } from 'react';
import { SortingRule } from 'react-table';
import { useProjectFeaturesArchive } from 'hooks/api/getters/useProjectFeaturesArchive/useProjectFeaturesArchive';
import { createLocalStorage } from 'utils/createLocalStorage';
import { ArchiveTable } from './ArchiveTable/ArchiveTable';
const defaultSort: SortingRule<string> = { id: 'archivedAt' };
@ -9,14 +10,11 @@ interface IProjectFeaturesTable {
projectId: string;
}
export const ProjectFeaturesArchiveTable = ({
export const ProjectFeaturesArchiveTable: VFC<IProjectFeaturesTable> = ({
projectId,
}: IProjectFeaturesTable) => {
const {
archivedFeatures = [],
refetchArchived,
loading,
} = useProjectFeaturesArchive(projectId);
}) => {
const { archivedFeatures, loading, refetchArchived } =
useFeaturesArchive(projectId);
const { value, setValue } = createLocalStorage(
`${projectId}:ProjectFeaturesArchiveTable`,
@ -26,7 +24,7 @@ export const ProjectFeaturesArchiveTable = ({
return (
<ArchiveTable
title="Project archive"
archivedFeatures={archivedFeatures}
archivedFeatures={archivedFeatures || []}
loading={loading}
storedParams={value}
setStoredParams={setValue}

View File

@ -1,6 +1,6 @@
import { DragEventHandler, FC, ReactNode } from 'react';
import { DragIndicator } from '@mui/icons-material';
import { styled, IconButton, Box, SxProps, Theme } from '@mui/material';
import { styled, IconButton, Box } from '@mui/material';
import classNames from 'classnames';
import { IFeatureStrategy } from 'interfaces/strategy';
import {
@ -10,7 +10,7 @@ import {
import StringTruncator from 'component/common/StringTruncator/StringTruncator';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { useStyles } from './StrategyItemContainer.styles';
import { PlaygroundStrategySchema } from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundStrategySchema } from 'openapi';
interface IStrategyItemContainerProps {
strategy: IFeatureStrategy | PlaygroundStrategySchema;

View File

@ -4,7 +4,6 @@ import useMediaQuery from '@mui/material/useMediaQuery';
import { Add } from '@mui/icons-material';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { NAVIGATE_TO_CREATE_FEATURE } from 'utils/testIds';
import { IFeaturesFilter } from 'hooks/useFeaturesFilter';
import { useCreateFeaturePath } from 'component/feature/CreateFeatureButton/useCreateFeaturePath';
import PermissionButton from 'component/common/PermissionButton/PermissionButton';
import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions';
@ -12,7 +11,10 @@ import PermissionIconButton from 'component/common/PermissionIconButton/Permissi
interface ICreateFeatureButtonProps {
loading: boolean;
filter: IFeaturesFilter;
filter: {
query?: string;
project: string;
};
}
export const CreateFeatureButton = ({

View File

@ -1,18 +1,16 @@
import { useDefaultProjectId } from 'hooks/api/getters/useDefaultProject/useDefaultProjectId';
import { IFeaturesFilter } from 'hooks/useFeaturesFilter';
import { getCreateTogglePath } from 'utils/routePathHelpers';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
interface IUseCreateFeaturePathOutput {
path: string;
projectId: string;
}
export const useCreateFeaturePath = (
filter: IFeaturesFilter
): IUseCreateFeaturePathOutput | undefined => {
export const useCreateFeaturePath = (filter: {
query?: string;
project: string;
}): IUseCreateFeaturePathOutput | undefined => {
const defaultProjectId = useDefaultProjectId();
const { uiConfig } = useUiConfig();
const projectId =
filter.project === '*' || !filter.project

View File

@ -8,7 +8,7 @@ import { formatUnknownError } from 'utils/formatUnknownError';
import { PlaygroundResultsTable } from './PlaygroundResultsTable/PlaygroundResultsTable';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { usePlaygroundApi } from 'hooks/api/actions/usePlayground/usePlayground';
import { PlaygroundResponseSchema } from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundResponseSchema } from 'openapi';
import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments';
import { PlaygroundForm } from './PlaygroundForm/PlaygroundForm';
import {

View File

@ -1,6 +1,6 @@
import { colors } from 'themes/colors';
import { Alert, styled } from '@mui/material';
import { SdkContextSchema } from 'component/playground/Playground/interfaces/playground.model';
import { SdkContextSchema } from 'openapi';
interface IContextBannerProps {
environment: string;

View File

@ -1,7 +1,4 @@
import {
PlaygroundFeatureSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundFeatureSchema, PlaygroundRequestSchema } from 'openapi';
import { Alert, IconButton, Typography, useTheme, styled } from '@mui/material';
import { PlaygroundResultChip } from '../../PlaygroundResultChip/PlaygroundResultChip';
import { CloseOutlined } from '@mui/icons-material';

View File

@ -1,4 +1,4 @@
import { PlaygroundFeatureSchema } from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundFeatureSchema } from 'openapi';
export const DEFAULT_STRATEGIES = [
'default',

View File

@ -1,8 +1,5 @@
import { useRef, useState } from 'react';
import {
PlaygroundFeatureSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundFeatureSchema, PlaygroundRequestSchema } from 'openapi';
import { IconButton, Popover, styled } from '@mui/material';
import { InfoOutlined } from '@mui/icons-material';
import { FeatureDetails } from './FeatureDetails/FeatureDetails';

View File

@ -3,10 +3,7 @@ import {
WrappedPlaygroundResultStrategyList,
} from './StrategyList/playgroundResultStrategyLists';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import {
PlaygroundFeatureSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundFeatureSchema, PlaygroundRequestSchema } from 'openapi';
import { Alert } from '@mui/material';
interface PlaygroundResultFeatureStrategyListProps {

View File

@ -1,9 +1,6 @@
import { useTheme } from '@mui/material';
import { PlaygroundResultChip } from '../../../../PlaygroundResultChip/PlaygroundResultChip';
import {
PlaygroundStrategySchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundStrategySchema, PlaygroundRequestSchema } from 'openapi';
import { StrategyExecution } from './StrategyExecution/StrategyExecution';
import { StrategyItemContainer } from 'component/common/StrategyItemContainer/StrategyItemContainer';
import { objectId } from 'utils/objectId';

View File

@ -1,9 +1,6 @@
import { styled, Typography } from '@mui/material';
import { CancelOutlined } from '@mui/icons-material';
import {
PlaygroundConstraintSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundConstraintSchema, PlaygroundRequestSchema } from 'openapi';
const StyledConstraintErrorDiv = styled('div')(({ theme }) => ({
display: 'flex',

View File

@ -1,8 +1,5 @@
import { Fragment, VFC } from 'react';
import {
PlaygroundConstraintSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundConstraintSchema, PlaygroundRequestSchema } from 'openapi';
import { objectId } from 'utils/objectId';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { StrategySeparator } from 'component/common/StrategySeparator/StrategySeparator';

View File

@ -1,8 +1,5 @@
import { Fragment, VFC } from 'react';
import {
PlaygroundSegmentSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundSegmentSchema, PlaygroundRequestSchema } from 'openapi';
import { ConstraintExecution } from '../ConstraintExecution/ConstraintExecution';
import { CancelOutlined } from '@mui/icons-material';
import { StrategySeparator } from 'component/common/StrategySeparator/StrategySeparator';

View File

@ -2,10 +2,7 @@ import { Fragment, VFC } from 'react';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { StrategySeparator } from 'component/common/StrategySeparator/StrategySeparator';
import { Chip, styled } from '@mui/material';
import {
PlaygroundRequestSchema,
PlaygroundStrategySchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundRequestSchema, PlaygroundStrategySchema } from 'openapi';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { ConstraintExecution } from './ConstraintExecution/ConstraintExecution';
import { SegmentExecution } from './SegmentExecution/SegmentExecution';

View File

@ -6,10 +6,7 @@ import { Box, Chip } from '@mui/material';
import PercentageCircle from 'component/common/PercentageCircle/PercentageCircle';
import { PlaygroundParameterItem } from '../PlaygroundParameterItem/PlaygroundParameterItem';
import { StyledBoxSummary } from '../StrategyExecution.styles';
import {
PlaygroundConstraintSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundConstraintSchema, PlaygroundRequestSchema } from 'openapi';
import { getMappedParam } from '../helpers';
export interface PlaygroundResultStrategyExecutionParametersProps {

View File

@ -3,8 +3,8 @@ import { Alert, Box, styled, Typography } from '@mui/material';
import {
PlaygroundStrategySchema,
PlaygroundRequestSchema,
PlaygroundStrategyResultSchema,
} from 'component/playground/Playground/interfaces/playground.model';
PlaygroundFeatureSchemaStrategies,
} from 'openapi';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { FeatureStrategyItem } from './StrategyItem/FeatureStrategyItem';
import { StrategySeparator } from 'component/common/StrategySeparator/StrategySeparator';
@ -67,7 +67,7 @@ export const PlaygroundResultStrategyLists = ({
);
interface IWrappedPlaygroundResultStrategyListProps {
strategies: PlaygroundStrategyResultSchema;
strategies: PlaygroundFeatureSchemaStrategies;
input?: PlaygroundRequestSchema;
}

View File

@ -1,7 +1,7 @@
import React from 'react';
import { Box, styled } from '@mui/material';
import { PlaygroundResultChip } from '../PlaygroundResultChip/PlaygroundResultChip';
import { PlaygroundFeatureSchema } from '../../interfaces/playground.model';
import { PlaygroundFeatureSchema } from 'openapi';
interface IFeatureStatusCellProps {
feature: PlaygroundFeatureSchema;

View File

@ -18,10 +18,7 @@ import { LinkCell } from 'component/common/Table/cells/LinkCell/LinkCell';
import { useSearch } from 'hooks/useSearch';
import { createLocalStorage } from 'utils/createLocalStorage';
import { FeatureStatusCell } from './FeatureStatusCell/FeatureStatusCell';
import {
PlaygroundFeatureSchema,
PlaygroundRequestSchema,
} from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundFeatureSchema, PlaygroundRequestSchema } from 'openapi';
import { Box, Typography, useMediaQuery, useTheme } from '@mui/material';
import useLoading from 'hooks/useLoading';
import { VariantCell } from './VariantCell/VariantCell';

View File

@ -1,321 +0,0 @@
/**
*
* 09/08/2022
* This was copied from the openapi-generator generated files and slightly modified
* because of malformed generation of `anyOf`, `oneOf`
*
* https://github.com/OpenAPITools/openapi-generator/issues/12256
*/
import { VariantSchema } from 'openapi';
import { Operator } from 'constants/operators';
export interface PlaygroundConstraintSchema {
/**
* The name of the context field that this constraint should apply to.
* @type {string}
* @memberof PlaygroundConstraintSchema
*/
contextName: string;
/**
* The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/reference/strategy-constraints#strategy-constraint-operators).
* @type {string}
* @memberof PlaygroundConstraintSchema
*/
operator: Operator;
/**
* Whether the operator should be case-sensitive or not. Defaults to `false` (being case-sensitive).
* @type {boolean}
* @memberof PlaygroundConstraintSchema
*/
caseInsensitive?: boolean;
/**
* Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.
* @type {boolean}
* @memberof PlaygroundConstraintSchema
*/
inverted?: boolean;
/**
* The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.
* @type {Array<string>}
* @memberof PlaygroundConstraintSchema
*/
values?: Array<string>;
/**
* The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.
* @type {string}
* @memberof PlaygroundConstraintSchema
*/
value?: string;
/**
* Whether this was evaluated as true or false.
* @type {boolean}
* @memberof PlaygroundConstraintSchema
*/
result: boolean;
}
export interface PlaygroundFeatureSchema {
/**
* The feature's name.
* @type {string}
* @memberof PlaygroundFeatureSchema
*/
name: string;
/**
* The ID of the project that contains this feature.
* @type {string}
* @memberof PlaygroundFeatureSchema
*/
projectId: string;
/**
* The strategies that apply to this feature.
* @type {Array<PlaygroundStrategySchema>}
* @memberof PlaygroundFeatureSchema
*/
strategies: PlaygroundStrategyResultSchema;
/**
* Whether the feature is active and would be evaluated in the provided environment in a normal SDK context.
* @type {boolean}
* @memberof PlaygroundFeatureSchema
*/
isEnabledInCurrentEnvironment: boolean;
/**
*
* @type {boolean | 'unevaluated'}
* @memberof PlaygroundFeatureSchema
*/
isEnabled: boolean;
/**
*
* @type {PlaygroundFeatureSchemaVariant}
* @memberof PlaygroundFeatureSchema
*/
variant: PlaygroundFeatureSchemaVariant | null;
/**
*
* @type {Array<VariantSchema>}
* @memberof PlaygroundFeatureSchema
*/
variants: Array<VariantSchema>;
}
export interface PlaygroundFeatureSchemaVariant {
/**
* The variant's name. If there is no variant or if the toggle is disabled, this will be `disabled`
* @type {string}
* @memberof PlaygroundFeatureSchemaVariant
*/
name: string;
/**
* Whether the variant is enabled or not. If the feature is disabled or if it doesn't have variants, this property will be `false`
* @type {boolean}
* @memberof PlaygroundFeatureSchemaVariant
*/
enabled: boolean;
/**
*
* @type {PlaygroundFeatureSchemaVariantPayload}
* @memberof PlaygroundFeatureSchemaVariant
*/
payload?: PlaygroundFeatureSchemaVariantPayload;
}
export interface PlaygroundFeatureSchemaVariantPayload {
/**
* The format of the payload.
* @type {string}
* @memberof PlaygroundFeatureSchemaVariantPayload
*/
type: PlaygroundFeatureSchemaVariantPayloadTypeEnum;
/**
* The payload value stringified.
* @type {string}
* @memberof PlaygroundFeatureSchemaVariantPayload
*/
value: string;
}
export const playgroundFeatureSchemaVariantPayloadTypeEnum = {
Json: 'json',
Csv: 'csv',
String: 'string',
} as const;
export type PlaygroundFeatureSchemaVariantPayloadTypeEnum =
typeof playgroundFeatureSchemaVariantPayloadTypeEnum[keyof typeof playgroundFeatureSchemaVariantPayloadTypeEnum];
export interface PlaygroundRequestSchema {
/**
* The environment to evaluate toggles in.
* @type {string}
* @memberof PlaygroundRequestSchema
*/
environment: string;
/**
*
* @type {PlaygroundRequestSchemaProjects}
* @memberof PlaygroundRequestSchema
*/
projects?: PlaygroundRequestSchemaProjects;
/**
*
* @type {SdkContextSchema}
* @memberof PlaygroundRequestSchema
*/
context: SdkContextSchema;
}
export type PlaygroundRequestSchemaProjects = Array<string> | string;
export interface PlaygroundResponseSchema {
/**
*
* @type {PlaygroundRequestSchema}
* @memberof PlaygroundResponseSchema
*/
input: PlaygroundRequestSchema;
/**
* The list of features that have been evaluated.
* @type {Array<PlaygroundFeatureSchema>}
* @memberof PlaygroundResponseSchema
*/
features: Array<PlaygroundFeatureSchema>;
}
export interface PlaygroundSegmentSchema {
/**
* The segment's id.
* @type {number}
* @memberof PlaygroundSegmentSchema
*/
id: number;
/**
* The name of the segment.
* @type {string}
* @memberof PlaygroundSegmentSchema
*/
name: string;
/**
* Whether this was evaluated as true or false.
* @type {boolean}
* @memberof PlaygroundSegmentSchema
*/
result: boolean;
/**
* The list of constraints in this segment.
* @type {Array<PlaygroundConstraintSchema>}
* @memberof PlaygroundSegmentSchema
*/
constraints: Array<PlaygroundConstraintSchema>;
}
export interface PlaygroundStrategyResultSchema {
result: boolean | 'unknown';
data?: Array<PlaygroundStrategySchema>;
}
export interface PlaygroundStrategySchema {
/**
* The strategy's name.
* @type {string}
* @memberof PlaygroundStrategySchema
*/
name: string;
/**
* The strategy's id.
* @type {string}
* @memberof PlaygroundStrategySchema
*/
id?: string;
/**
*
* @type {PlaygroundStrategySchemaResult}
* @memberof PlaygroundStrategySchema
*/
result: PlaygroundStrategySchemaResult;
/**
* The strategy's segments and their evaluation results.
* @type {Array<PlaygroundSegmentSchema>}
* @memberof PlaygroundStrategySchema
*/
segments: Array<PlaygroundSegmentSchema>;
/**
* The strategy's constraints and their evaluation results.
* @type {Array<PlaygroundConstraintSchema>}
* @memberof PlaygroundStrategySchema
*/
constraints: Array<PlaygroundConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof PlaygroundStrategySchema
*/
parameters: { [key: string]: string };
}
export enum PlaygroundStrategyResultEvaluationStatusEnum {
complete = 'complete',
incomplete = 'incomplete',
}
export interface PlaygroundStrategySchemaResult {
/**
* Signals that this strategy was evaluated successfully.
* @type {string}
* @memberof PlaygroundStrategySchemaResult
*/
evaluationStatus?: PlaygroundStrategyResultEvaluationStatusEnum;
/**
* Whether this strategy evaluates to true or not.
* @type {boolean}
* @memberof PlaygroundStrategySchemaResult
*/
enabled: boolean;
}
export interface SdkContextSchema {
[key: string]: string | any;
/**
*
* @type {string}
* @memberof SdkContextSchema
*/
appName: string;
/**
*
* @type {Date}
* @memberof SdkContextSchema
*/
currentTime?: Date;
/**
*
* @type {string}
* @memberof SdkContextSchema
* @deprecated
*/
environment?: string;
/**
*
* @type {{ [key: string]: string; }}
* @memberof SdkContextSchema
*/
properties?: { [key: string]: string };
/**
*
* @type {string}
* @memberof SdkContextSchema
*/
remoteAddress?: string;
/**
*
* @type {string}
* @memberof SdkContextSchema
*/
sessionId?: string;
/**
*
* @type {string}
* @memberof SdkContextSchema
*/
userId?: string;
}

View File

@ -1,14 +1,22 @@
import { PlaygroundResponseSchema } from 'component/playground/Playground/interfaces/playground.model';
import { PlaygroundResponseSchema } from 'openapi';
import { IEnvironment } from 'interfaces/environments';
export const resolveProjects = (
projects: string[] | string
): string[] | string => {
return !projects ||
): string[] | '*' => {
if (
!projects ||
projects.length === 0 ||
(projects.length === 1 && projects[0] === '*')
? '*'
: projects;
) {
return '*';
}
if (Array.isArray(projects)) {
return projects;
}
return [projects];
};
export const resolveDefaultEnvironment = (

View File

@ -1,197 +0,0 @@
// Vitest Snapshot v1
exports[`useFeaturesFilter constraints 1`] = `
{
"filter": {
"project": "*",
"query": "xyz",
},
"filtered": [
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "a",
"stale": false,
"strategies": [
{
"constraints": [],
"id": "1",
"name": "1",
"parameters": {},
},
{
"constraints": [],
"id": "1",
"name": "1",
"parameters": {},
},
{
"constraints": [
{
"contextName": "",
"operator": "IN",
},
{
"contextName": "",
"operator": "IN",
"value": "xyz",
},
{
"contextName": "",
"operator": "IN",
"values": [
"xyz",
],
},
],
"id": "1",
"name": "1",
"parameters": {},
},
],
"type": "1",
"variants": [],
},
],
"setFilter": [Function],
}
`;
exports[`useFeaturesFilter empty 1`] = `
{
"filter": {
"project": "*",
},
"filtered": [],
"setFilter": [Function],
}
`;
exports[`useFeaturesFilter equal 1`] = `
{
"filter": {
"project": "*",
},
"filtered": [
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "1",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "1",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "1",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
],
"setFilter": [Function],
}
`;
exports[`useFeaturesFilter project 1`] = `
{
"filter": {
"project": "2",
},
"filtered": [
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "2",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "2",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
],
"setFilter": [Function],
}
`;
exports[`useFeaturesFilter query 1`] = `
{
"filter": {
"project": "*",
"query": "bc",
},
"filtered": [
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "abc",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
{
"createdAt": 2006-01-02T15:04:05.000Z,
"description": "1",
"enabled": false,
"impressionData": false,
"lastSeenAt": 2006-01-02T15:04:05.000Z,
"name": "1",
"project": "abcd",
"stale": false,
"strategies": [],
"type": "1",
"variants": [],
},
],
"setFilter": [Function],
}
`;

View File

@ -1,10 +1,9 @@
import { ITag } from 'interfaces/tags';
import useAPI from '../useApi/useApi';
import { Operation } from 'fast-json-patch';
import { CreateFeatureSchema } from 'openapi';
import { openApiAdmin } from 'utils/openapiClient';
import { IConstraint } from 'interfaces/strategy';
import { useCallback } from 'react';
import { ITag } from 'interfaces/tags';
import { Operation } from 'fast-json-patch';
import { IConstraint } from 'interfaces/strategy';
import { CreateFeatureSchema } from 'openapi';
import useAPI from '../useApi/useApi';
const useFeatureApi = () => {
const { makeRequest, createRequest, errors, loading } = useAPI({
@ -42,10 +41,12 @@ const useFeatureApi = () => {
projectId: string,
createFeatureSchema: CreateFeatureSchema
) => {
return openApiAdmin.createFeature({
projectId,
createFeatureSchema,
const path = `/api/admin/projects/${projectId}/features`;
const req = createRequest(path, {
method: 'POST',
body: JSON.stringify(createFeatureSchema),
});
await makeRequest(req.caller, req.id);
};
const toggleFeatureEnvironmentOn = useCallback(

View File

@ -2,7 +2,7 @@ import useAPI from '../useApi/useApi';
import {
PlaygroundRequestSchema,
PlaygroundResponseSchema,
} from '../../../../component/playground/Playground/interfaces/playground.model';
} from '../../../../openapi';
export const usePlaygroundApi = () => {
const { makeRequest, createRequest, errors, loading } = useAPI({

View File

@ -1,6 +1,6 @@
import { openApiAdmin } from 'utils/openapiClient';
import { FeatureSchema } from 'openapi';
import { useApiGetter } from 'hooks/api/getters/useApiGetter/useApiGetter';
import useSWR from 'swr';
import { FeatureSchema, FeaturesSchema } from 'openapi';
import handleErrorResponses from '../httpErrorResponseHandler';
export interface IUseFeaturesArchiveOutput {
archivedFeatures?: FeatureSchema[];
@ -9,16 +9,29 @@ export interface IUseFeaturesArchiveOutput {
error?: Error;
}
export const useFeaturesArchive = (): IUseFeaturesArchiveOutput => {
const { data, refetch, loading, error } = useApiGetter(
'apiAdminArchiveFeaturesGet',
() => openApiAdmin.apiAdminArchiveFeaturesGet()
const fetcher = (path: string) => {
return fetch(path)
.then(handleErrorResponses('Feature toggle archive'))
.then(res => res.json());
};
export const useFeaturesArchive = (
projectId?: string
): IUseFeaturesArchiveOutput => {
const { data, error, mutate, isLoading } = useSWR<FeaturesSchema>(
projectId
? `/api/admin/archive/features/${projectId}`
: 'api/admin/features',
fetcher,
{
refreshInterval: 15 * 1000, // ms
}
);
return {
archivedFeatures: data?.features,
refetchArchived: refetch,
loading,
refetchArchived: mutate,
loading: isLoading,
error,
};
};

View File

@ -1,33 +0,0 @@
import { openApiAdmin } from 'utils/openapiClient';
import { FeatureSchema } from 'openapi';
import { useApiGetter } from 'hooks/api/getters/useApiGetter/useApiGetter';
export interface IUseProjectFeaturesArchiveOutput {
archivedFeatures?: FeatureSchema[];
refetchArchived: () => void;
loading: boolean;
error?: Error;
}
export const useProjectFeaturesArchive = (
projectId: string
): IUseProjectFeaturesArchiveOutput => {
const { data, refetch, loading, error } = useApiGetter(
['apiAdminArchiveFeaturesGet', projectId],
() => {
if (projectId) {
return openApiAdmin.apiAdminArchiveFeaturesProjectIdGet({
projectId,
});
}
return openApiAdmin.apiAdminArchiveFeaturesGet();
}
);
return {
archivedFeatures: data?.features,
refetchArchived: refetch,
loading,
error,
};
};

View File

@ -4,7 +4,6 @@ import { formatApiPath } from 'utils/formatPath';
import handleErrorResponses from '../httpErrorResponseHandler';
import { ISegment } from 'interfaces/segment';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { IFlags } from 'interfaces/uiConfig';
export interface IUseSegmentsOutput {
segments?: ISegment[];
@ -16,9 +15,13 @@ export interface IUseSegmentsOutput {
export const useSegments = (strategyId?: string): IUseSegmentsOutput => {
const { uiConfig } = useUiConfig();
const url = strategyId
? formatApiPath(`api/admin/segments/strategies/${strategyId}`)
: formatApiPath('api/admin/segments');
const { data, error, mutate } = useSWR(
[strategyId, uiConfig.flags],
fetchSegments,
url,
() => (uiConfig.flags?.SE ? fetchSegments(url) : []),
{
refreshInterval: 15 * 1000,
}
@ -36,22 +39,9 @@ export const useSegments = (strategyId?: string): IUseSegmentsOutput => {
};
};
export const fetchSegments = async (
strategyId?: string,
flags?: IFlags
): Promise<ISegment[]> => {
if (!flags?.SE) {
return [];
}
return fetch(formatSegmentsPath(strategyId))
export const fetchSegments = async (url: string): Promise<ISegment[]> => {
return fetch(url)
.then(handleErrorResponses('Segments'))
.then(res => res.json())
.then(res => res.segments);
};
const formatSegmentsPath = (strategyId?: string): string => {
return strategyId
? formatApiPath(`api/admin/segments/strategies/${strategyId}`)
: formatApiPath('api/admin/segments');
};

View File

@ -1,134 +0,0 @@
import { renderHook, act } from '@testing-library/react-hooks';
import { useFeaturesFilter } from 'hooks/useFeaturesFilter';
import {
FeatureSchema,
StrategySchema,
ConstraintSchema,
ConstraintSchemaOperatorEnum,
} from 'openapi';
import parseISO from 'date-fns/parseISO';
test('useFeaturesFilter empty', () => {
const { result } = renderHook(() => useFeaturesFilter([]));
expect(result.current.filtered.length).toEqual(0);
expect(result.current).toMatchSnapshot();
});
test('useFeaturesFilter equal', () => {
const { result } = renderHook(() =>
useFeaturesFilter([
mockFeatureToggle(),
mockFeatureToggle(),
mockFeatureToggle(),
])
);
expect(result.current.filtered.length).toEqual(3);
expect(result.current).toMatchSnapshot();
});
test('useFeaturesFilter project', () => {
const { result } = renderHook(() =>
useFeaturesFilter([
mockFeatureToggle({ project: '1' }),
mockFeatureToggle({ project: '2' }),
mockFeatureToggle({ project: '2' }),
mockFeatureToggle({ project: '3' }),
])
);
act(() => {
result.current.setFilter({ project: '2' });
});
expect(result.current.filtered.length).toEqual(2);
expect(result.current).toMatchSnapshot();
});
test('useFeaturesFilter query', () => {
const { result } = renderHook(() =>
useFeaturesFilter([
mockFeatureToggle({ project: 'a' }),
mockFeatureToggle({ project: 'ab' }),
mockFeatureToggle({ project: 'abc' }),
mockFeatureToggle({ project: 'abcd' }),
])
);
act(() => {
result.current.setFilter({ project: '*', query: 'bc' });
});
expect(result.current.filtered.length).toEqual(2);
expect(result.current).toMatchSnapshot();
});
test('useFeaturesFilter constraints', () => {
const { result } = renderHook(() =>
useFeaturesFilter([
mockFeatureToggle({
project: 'a',
strategies: [
mockFeatureStrategy(),
mockFeatureStrategy(),
mockFeatureStrategy({
constraints: [
mockConstraint(),
mockConstraint({ value: 'xyz' }),
mockConstraint({ values: ['xyz'] }),
],
}),
],
}),
])
);
act(() => {
result.current.setFilter({ project: '*', query: 'xyz' });
});
expect(result.current.filtered.length).toEqual(1);
expect(result.current).toMatchSnapshot();
});
const mockFeatureToggle = (
overrides?: Partial<FeatureSchema>
): FeatureSchema => {
return {
name: '1',
description: '1',
type: '1',
project: '1',
enabled: false,
stale: false,
impressionData: false,
strategies: [],
variants: [],
createdAt: parseISO('2006-01-02T15:04:05Z'),
lastSeenAt: parseISO('2006-01-02T15:04:05Z'),
...overrides,
};
};
const mockFeatureStrategy = (
overrides?: Partial<StrategySchema>
): StrategySchema => {
return {
id: '1',
name: '1',
constraints: [],
parameters: {},
...overrides,
};
};
const mockConstraint = (
overrides?: Partial<ConstraintSchema>
): ConstraintSchema => {
return {
contextName: '',
operator: ConstraintSchemaOperatorEnum.In,
...overrides,
};
};

View File

@ -1,112 +0,0 @@
import React, { useMemo } from 'react';
import { createGlobalStateHook } from 'hooks/useGlobalState';
import { FeatureSchema } from 'openapi';
import { safeRegExp } from '@server/util/escape-regex';
export interface IFeaturesFilter {
query?: string;
project: string;
}
export interface IFeaturesSortOutput {
filtered: FeatureSchema[];
filter: IFeaturesFilter;
setFilter: React.Dispatch<React.SetStateAction<IFeaturesFilter>>;
}
// Store the features filter state globally, and in localStorage.
// When changing the format of IFeaturesFilter, change the version as well.
const useFeaturesFilterState = createGlobalStateHook<IFeaturesFilter>(
'useFeaturesFilterState',
{ project: '*' }
);
export const useFeaturesFilter = (
features: FeatureSchema[]
): IFeaturesSortOutput => {
const [filter, setFilter] = useFeaturesFilterState();
const filtered = useMemo(() => {
return filterFeatures(features, filter);
}, [features, filter]);
return {
setFilter,
filter,
filtered,
};
};
const filterFeatures = (
features: FeatureSchema[],
filter: IFeaturesFilter
): FeatureSchema[] => {
return filterFeaturesByQuery(
filterFeaturesByProject(features, filter),
filter
);
};
const filterFeaturesByProject = (
features: FeatureSchema[],
filter: IFeaturesFilter
): FeatureSchema[] => {
return filter.project === '*'
? features
: features.filter(f => f.project === filter.project);
};
const filterFeaturesByQuery = (
features: FeatureSchema[],
filter: IFeaturesFilter
): FeatureSchema[] => {
if (!filter.query) {
return features;
}
// Try to parse the search query as a RegExp.
// Return all features if it can't be parsed.
try {
const regExp = safeRegExp(filter.query, 'i');
return features.filter(f => filterFeatureByRegExp(f, filter, regExp));
} catch (err) {
if (err instanceof SyntaxError) {
return features;
} else {
throw err;
}
}
};
const filterFeatureByRegExp = (
feature: FeatureSchema,
filter: IFeaturesFilter,
regExp: RegExp
): boolean => {
if (
regExp.test(feature.name) ||
(feature.description && regExp.test(feature.description))
) {
return true;
}
if (
filter.query &&
filter.query.length > 1 &&
regExp.test(JSON.stringify(feature))
) {
return true;
}
if (!feature.strategies) {
return false;
}
return feature.strategies.some(
strategy =>
regExp.test(strategy.name) ||
strategy.constraints?.some(constraint =>
constraint.values?.some(value => regExp.test(value))
)
);
};

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
/* tslint:disable */
/* eslint-disable */
export * from './AdminApi';

View File

@ -0,0 +1,50 @@
import { formatApiPath } from 'utils/formatPath';
/**
* Customize HTTP client, use Fetch instead of Axios
* @see https://orval.dev/guides/custom-client
*/
export const fetcher = async <T>({
url,
method,
params,
data,
headers,
credentials = 'include',
}: {
url: string;
method: 'get' | 'post' | 'put' | 'delete' | 'patch';
params?: string | URLSearchParams | Record<string, string> | string[][];
data?: BodyType<unknown>;
headers?: HeadersInit;
credentials?: RequestCredentials;
}): Promise<T> => {
const response = await fetch(
`${formatApiPath(url)}${new URLSearchParams(params)}`,
{
method,
credentials,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...headers,
},
...(data ? { body: JSON.stringify(data) } : {}),
}
);
return response.json();
};
export default fetcher;
/**
* In some case with react-query and swr you want to be able to override the return error type so you can also do it here like this
*/
export type ErrorType<Error> = Error;
/**
* In case you want to wrap the body type (optional)
* (if the custom instance is processing data before sending it, like changing the case for example)
*/
export type BodyType<BodyData> = BodyData;

View File

@ -1,5 +1 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis';
export * from './models';

View File

@ -1,64 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CloneFeatureSchema
*/
export interface CloneFeatureSchema {
/**
*
* @type {string}
* @memberof CloneFeatureSchema
*/
name: string;
/**
*
* @type {boolean}
* @memberof CloneFeatureSchema
*/
replaceGroupId?: boolean;
}
export function CloneFeatureSchemaFromJSON(json: any): CloneFeatureSchema {
return CloneFeatureSchemaFromJSONTyped(json, false);
}
export function CloneFeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): CloneFeatureSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'replaceGroupId': !exists(json, 'replaceGroupId') ? undefined : json['replaceGroupId'],
};
}
export function CloneFeatureSchemaToJSON(value?: CloneFeatureSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'replaceGroupId': value.replaceGroupId,
};
}

View File

@ -1,120 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ConstraintSchema
*/
export interface ConstraintSchema {
/**
*
* @type {string}
* @memberof ConstraintSchema
*/
contextName: string;
/**
*
* @type {string}
* @memberof ConstraintSchema
*/
operator: ConstraintSchemaOperatorEnum;
/**
*
* @type {boolean}
* @memberof ConstraintSchema
*/
caseInsensitive?: boolean;
/**
*
* @type {boolean}
* @memberof ConstraintSchema
*/
inverted?: boolean;
/**
*
* @type {Array<string>}
* @memberof ConstraintSchema
*/
values?: Array<string>;
/**
*
* @type {string}
* @memberof ConstraintSchema
*/
value?: string;
}
/**
* @export
*/
export const ConstraintSchemaOperatorEnum = {
NotIn: 'NOT_IN',
In: 'IN',
StrEndsWith: 'STR_ENDS_WITH',
StrStartsWith: 'STR_STARTS_WITH',
StrContains: 'STR_CONTAINS',
NumEq: 'NUM_EQ',
NumGt: 'NUM_GT',
NumGte: 'NUM_GTE',
NumLt: 'NUM_LT',
NumLte: 'NUM_LTE',
DateAfter: 'DATE_AFTER',
DateBefore: 'DATE_BEFORE',
SemverEq: 'SEMVER_EQ',
SemverGt: 'SEMVER_GT',
SemverLt: 'SEMVER_LT'
} as const;
export type ConstraintSchemaOperatorEnum = typeof ConstraintSchemaOperatorEnum[keyof typeof ConstraintSchemaOperatorEnum];
export function ConstraintSchemaFromJSON(json: any): ConstraintSchema {
return ConstraintSchemaFromJSONTyped(json, false);
}
export function ConstraintSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConstraintSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'contextName': json['contextName'],
'operator': json['operator'],
'caseInsensitive': !exists(json, 'caseInsensitive') ? undefined : json['caseInsensitive'],
'inverted': !exists(json, 'inverted') ? undefined : json['inverted'],
'values': !exists(json, 'values') ? undefined : json['values'],
'value': !exists(json, 'value') ? undefined : json['value'],
};
}
export function ConstraintSchemaToJSON(value?: ConstraintSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'contextName': value.contextName,
'operator': value.operator,
'caseInsensitive': value.caseInsensitive,
'inverted': value.inverted,
'values': value.values,
'value': value.value,
};
}

View File

@ -1,80 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateFeatureSchema
*/
export interface CreateFeatureSchema {
/**
*
* @type {string}
* @memberof CreateFeatureSchema
*/
name: string;
/**
*
* @type {string}
* @memberof CreateFeatureSchema
*/
type?: string;
/**
*
* @type {string}
* @memberof CreateFeatureSchema
*/
description?: string;
/**
*
* @type {boolean}
* @memberof CreateFeatureSchema
*/
impressionData?: boolean;
}
export function CreateFeatureSchemaFromJSON(json: any): CreateFeatureSchema {
return CreateFeatureSchemaFromJSONTyped(json, false);
}
export function CreateFeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFeatureSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'type': !exists(json, 'type') ? undefined : json['type'],
'description': !exists(json, 'description') ? undefined : json['description'],
'impressionData': !exists(json, 'impressionData') ? undefined : json['impressionData'],
};
}
export function CreateFeatureSchemaToJSON(value?: CreateFeatureSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'type': value.type,
'description': value.description,
'impressionData': value.impressionData,
};
}

View File

@ -1,87 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface CreateStrategySchema
*/
export interface CreateStrategySchema {
/**
*
* @type {string}
* @memberof CreateStrategySchema
*/
name: string;
/**
*
* @type {number}
* @memberof CreateStrategySchema
*/
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof CreateStrategySchema
*/
constraints?: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof CreateStrategySchema
*/
parameters?: { [key: string]: string; };
}
export function CreateStrategySchemaFromJSON(json: any): CreateStrategySchema {
return CreateStrategySchemaFromJSONTyped(json, false);
}
export function CreateStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateStrategySchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': !exists(json, 'parameters') ? undefined : json['parameters'],
};
}
export function CreateStrategySchemaToJSON(value?: CreateStrategySchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'sortOrder': value.sortOrder,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -1,95 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
FeatureStrategySchema,
FeatureStrategySchemaFromJSON,
FeatureStrategySchemaFromJSONTyped,
FeatureStrategySchemaToJSON,
} from './FeatureStrategySchema';
/**
*
* @export
* @interface FeatureEnvironmentSchema
*/
export interface FeatureEnvironmentSchema {
/**
*
* @type {string}
* @memberof FeatureEnvironmentSchema
*/
name: string;
/**
*
* @type {string}
* @memberof FeatureEnvironmentSchema
*/
environment?: string;
/**
*
* @type {string}
* @memberof FeatureEnvironmentSchema
*/
type?: string;
/**
*
* @type {boolean}
* @memberof FeatureEnvironmentSchema
*/
enabled: boolean;
/**
*
* @type {Array<FeatureStrategySchema>}
* @memberof FeatureEnvironmentSchema
*/
strategies?: Array<FeatureStrategySchema>;
}
export function FeatureEnvironmentSchemaFromJSON(json: any): FeatureEnvironmentSchema {
return FeatureEnvironmentSchemaFromJSONTyped(json, false);
}
export function FeatureEnvironmentSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureEnvironmentSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'environment': !exists(json, 'environment') ? undefined : json['environment'],
'type': !exists(json, 'type') ? undefined : json['type'],
'enabled': json['enabled'],
'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array<any>).map(FeatureStrategySchemaFromJSON)),
};
}
export function FeatureEnvironmentSchemaToJSON(value?: FeatureEnvironmentSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'environment': value.environment,
'type': value.type,
'enabled': value.enabled,
'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array<any>).map(FeatureStrategySchemaToJSON)),
};
}

View File

@ -1,252 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
FeatureEnvironmentSchema,
FeatureEnvironmentSchemaFromJSON,
FeatureEnvironmentSchemaFromJSONTyped,
FeatureEnvironmentSchemaToJSON,
} from './FeatureEnvironmentSchema';
import {
StrategySchema,
StrategySchemaFromJSON,
StrategySchemaFromJSONTyped,
StrategySchemaToJSON,
} from './StrategySchema';
import {
TagSchema,
TagSchemaFromJSON,
TagSchemaFromJSONTyped,
TagSchemaToJSON,
} from './TagSchema';
import {
VariantSchema,
VariantSchemaFromJSON,
VariantSchemaFromJSONTyped,
VariantSchemaToJSON,
} from './VariantSchema';
/**
*
* @export
* @interface FeatureSchema
*/
export interface FeatureSchema {
/**
*
* @type {string}
* @memberof FeatureSchema
*/
name: string;
/**
*
* @type {string}
* @memberof FeatureSchema
*/
type?: string;
/**
*
* @type {string}
* @memberof FeatureSchema
*/
description?: string;
/**
*
* @type {boolean}
* @memberof FeatureSchema
*/
archived?: boolean;
/**
*
* @type {string}
* @memberof FeatureSchema
*/
project?: string;
/**
*
* @type {boolean}
* @memberof FeatureSchema
*/
enabled?: boolean;
/**
*
* @type {boolean}
* @memberof FeatureSchema
*/
stale?: boolean;
/**
*
* @type {boolean}
* @memberof FeatureSchema
*/
impressionData?: boolean;
/**
*
* @type {Date}
* @memberof FeatureSchema
*/
createdAt?: Date | null;
/**
*
* @type {Date}
* @memberof FeatureSchema
*/
archivedAt?: Date | null;
/**
*
* @type {Date}
* @memberof FeatureSchema
*/
lastSeenAt?: Date | null;
/**
*
* @type {Array<FeatureEnvironmentSchema>}
* @memberof FeatureSchema
*/
environments?: Array<FeatureEnvironmentSchema>;
/**
*
* @type {Array<StrategySchema>}
* @memberof FeatureSchema
*/
strategies?: Array<StrategySchema>;
/**
*
* @type {Array<VariantSchema>}
* @memberof FeatureSchema
*/
variants?: Array<VariantSchema>;
/**
*
* @type {Array<TagSchema>}
* @memberof FeatureSchema
*/
tags?: Array<TagSchema> | null;
}
export function FeatureSchemaFromJSON(json: any): FeatureSchema {
return FeatureSchemaFromJSONTyped(json, false);
}
export function FeatureSchemaFromJSONTyped(
json: any,
ignoreDiscriminator: boolean
): FeatureSchema {
if (json === undefined || json === null) {
return json;
}
return {
name: json['name'],
type: !exists(json, 'type') ? undefined : json['type'],
description: !exists(json, 'description')
? undefined
: json['description'],
archived: !exists(json, 'archived') ? undefined : json['archived'],
project: !exists(json, 'project') ? undefined : json['project'],
enabled: !exists(json, 'enabled') ? undefined : json['enabled'],
stale: !exists(json, 'stale') ? undefined : json['stale'],
impressionData: !exists(json, 'impressionData')
? undefined
: json['impressionData'],
createdAt: !exists(json, 'createdAt')
? undefined
: json['createdAt'] === null
? null
: new Date(json['createdAt']),
archivedAt: !exists(json, 'archivedAt')
? undefined
: json['archivedAt'] === null
? null
: new Date(json['archivedAt']),
lastSeenAt: !exists(json, 'lastSeenAt')
? undefined
: json['lastSeenAt'] === null
? null
: new Date(json['lastSeenAt']),
environments: !exists(json, 'environments')
? undefined
: (json['environments'] as Array<any>).map(
FeatureEnvironmentSchemaFromJSON
),
strategies: !exists(json, 'strategies')
? undefined
: (json['strategies'] as Array<any>).map(StrategySchemaFromJSON),
variants: !exists(json, 'variants')
? undefined
: (json['variants'] as Array<any>).map(VariantSchemaFromJSON),
tags: !exists(json, 'tags')
? undefined
: json['tags'] === null
? null
: (json['tags'] as Array<any>).map(TagSchemaFromJSON),
};
}
export function FeatureSchemaToJSON(value?: FeatureSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
name: value.name,
type: value.type,
description: value.description,
archived: value.archived,
project: value.project,
enabled: value.enabled,
stale: value.stale,
impressionData: value.impressionData,
createdAt:
value.createdAt === undefined
? undefined
: value.createdAt === null
? null
: value.createdAt.toISOString().substr(0, 10),
archivedAt:
value.archivedAt === undefined
? undefined
: value.archivedAt === null
? null
: value.archivedAt.toISOString().substr(0, 10),
lastSeenAt:
value.lastSeenAt === undefined
? undefined
: value.lastSeenAt === null
? null
: value.lastSeenAt.toISOString().substr(0, 10),
environments:
value.environments === undefined
? undefined
: (value.environments as Array<any>).map(
FeatureEnvironmentSchemaToJSON
),
strategies:
value.strategies === undefined
? undefined
: (value.strategies as Array<any>).map(StrategySchemaToJSON),
variants:
value.variants === undefined
? undefined
: (value.variants as Array<any>).map(VariantSchemaToJSON),
tags:
value.tags === undefined
? undefined
: value.tags === null
? null
: (value.tags as Array<any>).map(TagSchemaToJSON),
};
}

View File

@ -1,135 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface FeatureStrategySchema
*/
export interface FeatureStrategySchema {
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
id: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
name?: string;
/**
*
* @type {Date}
* @memberof FeatureStrategySchema
*/
createdAt?: Date | null;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
featureName: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
projectId?: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
environment: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
strategyName: string;
/**
*
* @type {number}
* @memberof FeatureStrategySchema
*/
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof FeatureStrategySchema
*/
constraints: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof FeatureStrategySchema
*/
parameters: { [key: string]: string; };
}
export function FeatureStrategySchemaFromJSON(json: any): FeatureStrategySchema {
return FeatureStrategySchemaFromJSONTyped(json, false);
}
export function FeatureStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureStrategySchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'createdAt': !exists(json, 'createdAt') ? undefined : (json['createdAt'] === null ? null : new Date(json['createdAt'])),
'featureName': json['featureName'],
'projectId': !exists(json, 'projectId') ? undefined : json['projectId'],
'environment': json['environment'],
'strategyName': json['strategyName'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': json['parameters'],
};
}
export function FeatureStrategySchemaToJSON(value?: FeatureStrategySchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt === null ? null : value.createdAt.toISOString().substr(0,10)),
'featureName': value.featureName,
'projectId': value.projectId,
'environment': value.environment,
'strategyName': value.strategyName,
'sortOrder': value.sortOrder,
'constraints': ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -1,71 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
FeatureSchema,
FeatureSchemaFromJSON,
FeatureSchemaFromJSONTyped,
FeatureSchemaToJSON,
} from './FeatureSchema';
/**
*
* @export
* @interface FeaturesSchema
*/
export interface FeaturesSchema {
/**
*
* @type {number}
* @memberof FeaturesSchema
*/
version: number;
/**
*
* @type {Array<FeatureSchema>}
* @memberof FeaturesSchema
*/
features: Array<FeatureSchema>;
}
export function FeaturesSchemaFromJSON(json: any): FeaturesSchema {
return FeaturesSchemaFromJSONTyped(json, false);
}
export function FeaturesSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeaturesSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'version': json['version'],
'features': ((json['features'] as Array<any>).map(FeatureSchemaFromJSON)),
};
}
export function FeaturesSchemaToJSON(value?: FeaturesSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': value.version,
'features': ((value.features as Array<any>).map(FeatureSchemaToJSON)),
};
}

View File

@ -1,64 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface OverrideSchema
*/
export interface OverrideSchema {
/**
*
* @type {string}
* @memberof OverrideSchema
*/
contextName: string;
/**
*
* @type {Array<string>}
* @memberof OverrideSchema
*/
values: Array<string>;
}
export function OverrideSchemaFromJSON(json: any): OverrideSchema {
return OverrideSchemaFromJSONTyped(json, false);
}
export function OverrideSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): OverrideSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'contextName': json['contextName'],
'values': json['values'],
};
}
export function OverrideSchemaToJSON(value?: OverrideSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'contextName': value.contextName,
'values': value.values,
};
}

View File

@ -1,94 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface PatchOperationSchema
*/
export interface PatchOperationSchema {
/**
*
* @type {string}
* @memberof PatchOperationSchema
*/
path: string;
/**
*
* @type {string}
* @memberof PatchOperationSchema
*/
op: PatchOperationSchemaOpEnum;
/**
*
* @type {string}
* @memberof PatchOperationSchema
*/
from?: string;
/**
*
* @type {any}
* @memberof PatchOperationSchema
*/
value?: any | null;
}
/**
* @export
*/
export const PatchOperationSchemaOpEnum = {
Add: 'add',
Remove: 'remove',
Replace: 'replace',
Copy: 'copy',
Move: 'move'
} as const;
export type PatchOperationSchemaOpEnum = typeof PatchOperationSchemaOpEnum[keyof typeof PatchOperationSchemaOpEnum];
export function PatchOperationSchemaFromJSON(json: any): PatchOperationSchema {
return PatchOperationSchemaFromJSONTyped(json, false);
}
export function PatchOperationSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchOperationSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'path': json['path'],
'op': json['op'],
'from': !exists(json, 'from') ? undefined : json['from'],
'value': !exists(json, 'value') ? undefined : json['value'],
};
}
export function PatchOperationSchemaToJSON(value?: PatchOperationSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'path': value.path,
'op': value.op,
'from': value.from,
'value': value.value,
};
}

View File

@ -1,80 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.19.0-beta.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { RequestsPerSecondSchemaData } from './RequestsPerSecondSchemaData';
import {
RequestsPerSecondSchemaDataFromJSON,
RequestsPerSecondSchemaDataFromJSONTyped,
RequestsPerSecondSchemaDataToJSON,
} from './RequestsPerSecondSchemaData';
/**
*
* @export
* @interface RequestsPerSecondSchema
*/
export interface RequestsPerSecondSchema {
/**
*
* @type {string}
* @memberof RequestsPerSecondSchema
*/
status?: string;
/**
*
* @type {RequestsPerSecondSchemaData}
* @memberof RequestsPerSecondSchema
*/
data?: RequestsPerSecondSchemaData;
}
/**
* Check if a given object implements the RequestsPerSecondSchema interface.
*/
export function instanceOfRequestsPerSecondSchema(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function RequestsPerSecondSchemaFromJSON(json: any): RequestsPerSecondSchema {
return RequestsPerSecondSchemaFromJSONTyped(json, false);
}
export function RequestsPerSecondSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestsPerSecondSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'status': !exists(json, 'status') ? undefined : json['status'],
'data': !exists(json, 'data') ? undefined : RequestsPerSecondSchemaDataFromJSON(json['data']),
};
}
export function RequestsPerSecondSchemaToJSON(value?: RequestsPerSecondSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'status': value.status,
'data': RequestsPerSecondSchemaDataToJSON(value.data),
};
}

View File

@ -1,80 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.19.0-beta.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { RequestsPerSecondSchemaDataResultInner } from './RequestsPerSecondSchemaDataResultInner';
import {
RequestsPerSecondSchemaDataResultInnerFromJSON,
RequestsPerSecondSchemaDataResultInnerFromJSONTyped,
RequestsPerSecondSchemaDataResultInnerToJSON,
} from './RequestsPerSecondSchemaDataResultInner';
/**
*
* @export
* @interface RequestsPerSecondSchemaData
*/
export interface RequestsPerSecondSchemaData {
/**
*
* @type {string}
* @memberof RequestsPerSecondSchemaData
*/
resultType?: string;
/**
* An array of values per metric. Each one represents a line in the graph labeled by its metric name
* @type {Array<RequestsPerSecondSchemaDataResultInner>}
* @memberof RequestsPerSecondSchemaData
*/
result?: Array<RequestsPerSecondSchemaDataResultInner>;
}
/**
* Check if a given object implements the RequestsPerSecondSchemaData interface.
*/
export function instanceOfRequestsPerSecondSchemaData(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function RequestsPerSecondSchemaDataFromJSON(json: any): RequestsPerSecondSchemaData {
return RequestsPerSecondSchemaDataFromJSONTyped(json, false);
}
export function RequestsPerSecondSchemaDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestsPerSecondSchemaData {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'resultType': !exists(json, 'resultType') ? undefined : json['resultType'],
'result': !exists(json, 'result') ? undefined : ((json['result'] as Array<any>).map(RequestsPerSecondSchemaDataResultInnerFromJSON)),
};
}
export function RequestsPerSecondSchemaDataToJSON(value?: RequestsPerSecondSchemaData | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'resultType': value.resultType,
'result': value.result === undefined ? undefined : ((value.result as Array<any>).map(RequestsPerSecondSchemaDataResultInnerToJSON)),
};
}

View File

@ -1,86 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.19.0-beta.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { RequestsPerSecondSchemaDataResultInnerMetric } from './RequestsPerSecondSchemaDataResultInnerMetric';
import {
RequestsPerSecondSchemaDataResultInnerMetricFromJSON,
RequestsPerSecondSchemaDataResultInnerMetricFromJSONTyped,
RequestsPerSecondSchemaDataResultInnerMetricToJSON,
} from './RequestsPerSecondSchemaDataResultInnerMetric';
import type { RequestsPerSecondSchemaDataResultInnerValuesInnerInner } from './RequestsPerSecondSchemaDataResultInnerValuesInnerInner';
import {
RequestsPerSecondSchemaDataResultInnerValuesInnerInnerFromJSON,
RequestsPerSecondSchemaDataResultInnerValuesInnerInnerFromJSONTyped,
RequestsPerSecondSchemaDataResultInnerValuesInnerInnerToJSON,
} from './RequestsPerSecondSchemaDataResultInnerValuesInnerInner';
/**
*
* @export
* @interface RequestsPerSecondSchemaDataResultInner
*/
export interface RequestsPerSecondSchemaDataResultInner {
/**
*
* @type {RequestsPerSecondSchemaDataResultInnerMetric}
* @memberof RequestsPerSecondSchemaDataResultInner
*/
metric?: RequestsPerSecondSchemaDataResultInnerMetric;
/**
* An array of arrays. Each element of the array is an array of size 2 consisting of the 2 axis for the graph: in position zero the x axis represented as a number and position one the y axis represented as string
* @type {Array<Array<RequestsPerSecondSchemaDataResultInnerValuesInnerInner>>}
* @memberof RequestsPerSecondSchemaDataResultInner
*/
values?: Array<Array<RequestsPerSecondSchemaDataResultInnerValuesInnerInner>>;
}
/**
* Check if a given object implements the RequestsPerSecondSchemaDataResultInner interface.
*/
export function instanceOfRequestsPerSecondSchemaDataResultInner(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function RequestsPerSecondSchemaDataResultInnerFromJSON(json: any): RequestsPerSecondSchemaDataResultInner {
return RequestsPerSecondSchemaDataResultInnerFromJSONTyped(json, false);
}
export function RequestsPerSecondSchemaDataResultInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestsPerSecondSchemaDataResultInner {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'metric': !exists(json, 'metric') ? undefined : RequestsPerSecondSchemaDataResultInnerMetricFromJSON(json['metric']),
'values': !exists(json, 'values') ? undefined : json['values'],
};
}
export function RequestsPerSecondSchemaDataResultInnerToJSON(value?: RequestsPerSecondSchemaDataResultInner | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'metric': RequestsPerSecondSchemaDataResultInnerMetricToJSON(value.metric),
'values': value.values,
};
}

View File

@ -1,71 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.19.0-beta.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* A key value set representing the metric
* @export
* @interface RequestsPerSecondSchemaDataResultInnerMetric
*/
export interface RequestsPerSecondSchemaDataResultInnerMetric {
/**
*
* @type {string}
* @memberof RequestsPerSecondSchemaDataResultInnerMetric
*/
appName?: string;
/**
*
* @type {string}
* @memberof RequestsPerSecondSchemaDataResultInnerMetric
*/
endpoint?: string;
}
/**
* Check if a given object implements the RequestsPerSecondSchemaDataResultInnerMetric interface.
*/
export function instanceOfRequestsPerSecondSchemaDataResultInnerMetric(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function RequestsPerSecondSchemaDataResultInnerMetricFromJSON(json: any): RequestsPerSecondSchemaDataResultInnerMetric {
return RequestsPerSecondSchemaDataResultInnerMetricFromJSONTyped(json, false);
}
export function RequestsPerSecondSchemaDataResultInnerMetricFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestsPerSecondSchemaDataResultInnerMetric {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'appName': !exists(json, 'appName') ? undefined : json['appName'],
};
}
export function RequestsPerSecondSchemaDataResultInnerMetricToJSON(value?: RequestsPerSecondSchemaDataResultInnerMetric | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'appName': value.appName,
};
}

View File

@ -1,43 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.19.0-beta.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface RequestsPerSecondSchemaDataResultInnerValuesInnerInner
*/
export type RequestsPerSecondSchemaDataResultInnerValuesInnerInner = number | string;
/**
* Check if a given object implements the RequestsPerSecondSchemaDataResultInnerValuesInnerInner interface.
*/
export function instanceOfRequestsPerSecondSchemaDataResultInnerValuesInnerInner(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function RequestsPerSecondSchemaDataResultInnerValuesInnerInnerFromJSON(json: any): RequestsPerSecondSchemaDataResultInnerValuesInnerInner {
return RequestsPerSecondSchemaDataResultInnerValuesInnerInnerFromJSONTyped(json, false);
}
export function RequestsPerSecondSchemaDataResultInnerValuesInnerInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestsPerSecondSchemaDataResultInnerValuesInnerInner {
return json;
}
export function RequestsPerSecondSchemaDataResultInnerValuesInnerInnerToJSON(value?: RequestsPerSecondSchemaDataResultInnerValuesInnerInner | null): any {
return value;
}

View File

@ -1,80 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.19.0-beta.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { RequestsPerSecondSchema } from './RequestsPerSecondSchema';
import {
RequestsPerSecondSchemaFromJSON,
RequestsPerSecondSchemaFromJSONTyped,
RequestsPerSecondSchemaToJSON,
} from './RequestsPerSecondSchema';
/**
*
* @export
* @interface RequestsPerSecondSegmentedSchema
*/
export interface RequestsPerSecondSegmentedSchema {
/**
*
* @type {RequestsPerSecondSchema}
* @memberof RequestsPerSecondSegmentedSchema
*/
clientMetrics?: RequestsPerSecondSchema;
/**
*
* @type {RequestsPerSecondSchema}
* @memberof RequestsPerSecondSegmentedSchema
*/
adminMetrics?: RequestsPerSecondSchema;
}
/**
* Check if a given object implements the RequestsPerSecondSegmentedSchema interface.
*/
export function instanceOfRequestsPerSecondSegmentedSchema(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function RequestsPerSecondSegmentedSchemaFromJSON(json: any): RequestsPerSecondSegmentedSchema {
return RequestsPerSecondSegmentedSchemaFromJSONTyped(json, false);
}
export function RequestsPerSecondSegmentedSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): RequestsPerSecondSegmentedSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'clientMetrics': !exists(json, 'clientMetrics') ? undefined : RequestsPerSecondSchemaFromJSON(json['clientMetrics']),
'adminMetrics': !exists(json, 'adminMetrics') ? undefined : RequestsPerSecondSchemaFromJSON(json['adminMetrics']),
};
}
export function RequestsPerSecondSegmentedSchemaToJSON(value?: RequestsPerSecondSegmentedSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'clientMetrics': RequestsPerSecondSchemaToJSON(value.clientMetrics),
'adminMetrics': RequestsPerSecondSchemaToJSON(value.adminMetrics),
};
}

View File

@ -1,95 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface StrategySchema
*/
export interface StrategySchema {
/**
*
* @type {string}
* @memberof StrategySchema
*/
id?: string;
/**
*
* @type {string}
* @memberof StrategySchema
*/
name: string;
/**
*
* @type {number}
* @memberof StrategySchema
*/
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof StrategySchema
*/
constraints?: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof StrategySchema
*/
parameters?: { [key: string]: string; };
}
export function StrategySchemaFromJSON(json: any): StrategySchema {
return StrategySchemaFromJSONTyped(json, false);
}
export function StrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): StrategySchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': json['name'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': !exists(json, 'parameters') ? undefined : json['parameters'],
};
}
export function StrategySchemaToJSON(value?: StrategySchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'sortOrder': value.sortOrder,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -1,64 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface TagSchema
*/
export interface TagSchema {
/**
*
* @type {string}
* @memberof TagSchema
*/
value: string;
/**
*
* @type {string}
* @memberof TagSchema
*/
type: string;
}
export function TagSchemaFromJSON(json: any): TagSchema {
return TagSchemaFromJSONTyped(json, false);
}
export function TagSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'value': json['value'],
'type': json['type'],
};
}
export function TagSchemaToJSON(value?: TagSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'value': value.value,
'type': value.type,
};
}

View File

@ -1,71 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
TagSchema,
TagSchemaFromJSON,
TagSchemaFromJSONTyped,
TagSchemaToJSON,
} from './TagSchema';
/**
*
* @export
* @interface TagsResponseSchema
*/
export interface TagsResponseSchema {
/**
*
* @type {number}
* @memberof TagsResponseSchema
*/
version: number;
/**
*
* @type {Array<TagSchema>}
* @memberof TagsResponseSchema
*/
tags: Array<TagSchema>;
}
export function TagsResponseSchemaFromJSON(json: any): TagsResponseSchema {
return TagsResponseSchemaFromJSONTyped(json, false);
}
export function TagsResponseSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagsResponseSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'version': json['version'],
'tags': ((json['tags'] as Array<any>).map(TagSchemaFromJSON)),
};
}
export function TagsResponseSchemaToJSON(value?: TagsResponseSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': value.version,
'tags': ((value.tags as Array<any>).map(TagSchemaToJSON)),
};
}

View File

@ -1,119 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface UpdateFeatureSchema
*/
export interface UpdateFeatureSchema {
/**
*
* @type {string}
* @memberof UpdateFeatureSchema
*/
name: string;
/**
*
* @type {string}
* @memberof UpdateFeatureSchema
*/
description?: string;
/**
*
* @type {string}
* @memberof UpdateFeatureSchema
*/
type?: string;
/**
*
* @type {boolean}
* @memberof UpdateFeatureSchema
*/
stale?: boolean;
/**
*
* @type {boolean}
* @memberof UpdateFeatureSchema
*/
archived?: boolean;
/**
*
* @type {Date}
* @memberof UpdateFeatureSchema
*/
createdAt?: Date;
/**
*
* @type {boolean}
* @memberof UpdateFeatureSchema
*/
impressionData?: boolean;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof UpdateFeatureSchema
*/
constraints?: Array<ConstraintSchema>;
}
export function UpdateFeatureSchemaFromJSON(json: any): UpdateFeatureSchema {
return UpdateFeatureSchemaFromJSONTyped(json, false);
}
export function UpdateFeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateFeatureSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'type': !exists(json, 'type') ? undefined : json['type'],
'stale': !exists(json, 'stale') ? undefined : json['stale'],
'archived': !exists(json, 'archived') ? undefined : json['archived'],
'createdAt': !exists(json, 'createdAt') ? undefined : (new Date(json['createdAt'])),
'impressionData': !exists(json, 'impressionData') ? undefined : json['impressionData'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
};
}
export function UpdateFeatureSchemaToJSON(value?: UpdateFeatureSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
'type': value.type,
'stale': value.stale,
'archived': value.archived,
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt.toISOString().substr(0,10)),
'impressionData': value.impressionData,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
};
}

View File

@ -1,95 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface UpdateStrategySchema
*/
export interface UpdateStrategySchema {
/**
*
* @type {string}
* @memberof UpdateStrategySchema
*/
id?: string;
/**
*
* @type {string}
* @memberof UpdateStrategySchema
*/
name?: string;
/**
*
* @type {number}
* @memberof UpdateStrategySchema
*/
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof UpdateStrategySchema
*/
constraints?: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof UpdateStrategySchema
*/
parameters?: { [key: string]: string; };
}
export function UpdateStrategySchemaFromJSON(json: any): UpdateStrategySchema {
return UpdateStrategySchemaFromJSONTyped(json, false);
}
export function UpdateStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateStrategySchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': !exists(json, 'parameters') ? undefined : json['parameters'],
};
}
export function UpdateStrategySchemaToJSON(value?: UpdateStrategySchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'sortOrder': value.sortOrder,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -1,109 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import {
OverrideSchema,
OverrideSchemaFromJSON,
OverrideSchemaFromJSONTyped,
OverrideSchemaToJSON,
} from './OverrideSchema';
import {
VariantSchemaPayload,
VariantSchemaPayloadFromJSON,
VariantSchemaPayloadFromJSONTyped,
VariantSchemaPayloadToJSON,
} from './VariantSchemaPayload';
/**
*
* @export
* @interface VariantSchema
*/
export interface VariantSchema {
/**
*
* @type {string}
* @memberof VariantSchema
*/
name: string;
/**
*
* @type {number}
* @memberof VariantSchema
*/
weight: number;
/**
*
* @type {string}
* @memberof VariantSchema
*/
weightType: string;
/**
*
* @type {string}
* @memberof VariantSchema
*/
stickiness: string;
/**
*
* @type {VariantSchemaPayload}
* @memberof VariantSchema
*/
payload?: VariantSchemaPayload;
/**
*
* @type {Array<OverrideSchema>}
* @memberof VariantSchema
*/
overrides?: Array<OverrideSchema>;
}
export function VariantSchemaFromJSON(json: any): VariantSchema {
return VariantSchemaFromJSONTyped(json, false);
}
export function VariantSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): VariantSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'weight': json['weight'],
'weightType': json['weightType'],
'stickiness': json['stickiness'],
'payload': !exists(json, 'payload') ? undefined : VariantSchemaPayloadFromJSON(json['payload']),
'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array<any>).map(OverrideSchemaFromJSON)),
};
}
export function VariantSchemaToJSON(value?: VariantSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'weight': value.weight,
'weightType': value.weightType,
'stickiness': value.stickiness,
'payload': VariantSchemaPayloadToJSON(value.payload),
'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array<any>).map(OverrideSchemaToJSON)),
};
}

View File

@ -1,64 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface VariantSchemaPayload
*/
export interface VariantSchemaPayload {
/**
*
* @type {string}
* @memberof VariantSchemaPayload
*/
type: string;
/**
*
* @type {string}
* @memberof VariantSchemaPayload
*/
value: string;
}
export function VariantSchemaPayloadFromJSON(json: any): VariantSchemaPayload {
return VariantSchemaPayloadFromJSONTyped(json, false);
}
export function VariantSchemaPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): VariantSchemaPayload {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': json['type'],
'value': json['value'],
};
}
export function VariantSchemaPayloadToJSON(value?: VariantSchemaPayload | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'value': value.value,
};
}

View File

@ -0,0 +1,16 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface AddonParameterSchema {
name: string;
displayName: string;
type: string;
description?: string;
placeholder?: string;
required: boolean;
sensitive: boolean;
}

View File

@ -0,0 +1,19 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { AddonSchemaParameters } from './addonSchemaParameters';
export interface AddonSchema {
id?: number;
createdAt?: string | null;
provider: string;
description?: string;
enabled: boolean;
parameters: AddonSchemaParameters;
events: string[];
projects?: string[];
environments?: string[];
}

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type AddonSchemaParameters = { [key: string]: any };

View File

@ -0,0 +1,18 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { TagTypeSchema } from './tagTypeSchema';
import type { AddonParameterSchema } from './addonParameterSchema';
export interface AddonTypeSchema {
name: string;
displayName: string;
documentationUrl: string;
description: string;
tagTypes?: TagTypeSchema[];
parameters?: AddonParameterSchema[];
events?: string[];
}

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { AddonSchema } from './addonSchema';
import type { AddonTypeSchema } from './addonTypeSchema';
export interface AddonsSchema {
addons: AddonSchema[];
providers: AddonTypeSchema[];
}

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface AdminFeaturesQuerySchema {
/** Used to filter by tags. For each entry, a TAGTYPE:TAGVALUE is expected */
tag?: string[];
/** A case-insensitive prefix filter for the names of feature toggles */
namePrefix?: string;
}

View File

@ -0,0 +1,14 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface AdminPermissionSchema {
id: number;
name: string;
displayName: string;
type: string;
environment?: string;
}

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { AdminPermissionsSchemaPermissions } from './adminPermissionsSchemaPermissions';
export interface AdminPermissionsSchema {
permissions: AdminPermissionsSchemaPermissions;
version: number;
}

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { AdminPermissionSchema } from './adminPermissionSchema';
import type { AdminPermissionsSchemaPermissionsEnvironmentsItem } from './adminPermissionsSchemaPermissionsEnvironmentsItem';
export type AdminPermissionsSchemaPermissions = {
project: AdminPermissionSchema[];
environments: AdminPermissionsSchemaPermissionsEnvironmentsItem[];
};

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { AdminPermissionSchema } from './adminPermissionSchema';
export type AdminPermissionsSchemaPermissionsEnvironmentsItem = {
name: string;
permissions: AdminPermissionSchema[];
};

View File

@ -0,0 +1,16 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ConstraintSchema } from './constraintSchema';
export interface AdminSegmentSchema {
id: number;
name: string;
description?: string | null;
constraints: ConstraintSchema[];
createdBy?: string;
createdAt: string;
}

View File

@ -0,0 +1,20 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ApiTokenSchemaType } from './apiTokenSchemaType';
export interface ApiTokenSchema {
secret?: string;
username: string;
type: ApiTokenSchemaType;
environment?: string;
project?: string;
projects?: string[];
expiresAt?: string | null;
createdAt?: string | null;
seenAt?: string | null;
alias?: string | null;
}

View File

@ -0,0 +1,16 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ApiTokenSchemaType =
typeof ApiTokenSchemaType[keyof typeof ApiTokenSchemaType];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ApiTokenSchemaType = {
client: 'client',
admin: 'admin',
frontend: 'frontend',
} as const;

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ApiTokenSchema } from './apiTokenSchema';
export interface ApiTokensSchema {
tokens: ApiTokenSchema[];
}

View File

@ -0,0 +1,17 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface ApplicationSchema {
appName: string;
sdkVersion?: string;
strategies?: string[];
description?: string;
url?: string;
color?: string;
icon?: string;
announced?: boolean;
}

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ApplicationSchema } from './applicationSchema';
export interface ApplicationsSchema {
applications?: ApplicationSchema[];
}

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface ChangePasswordSchema {
token: string;
password: string;
}

View File

@ -0,0 +1,10 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface ChangeProjectSchema {
newProjectId: string;
}

View File

@ -0,0 +1,10 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface ChangeRequestAddCommentSchema {
text: string;
}

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestApprovalSchemaCreatedBy } from './changeRequestApprovalSchemaCreatedBy';
export interface ChangeRequestApprovalSchema {
createdBy: ChangeRequestApprovalSchemaCreatedBy;
createdAt: string;
}

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestApprovalSchemaCreatedBy = {
id?: number;
username?: string | null;
imageUrl?: string | null;
};

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestCommentSchemaCreatedBy } from './changeRequestCommentSchemaCreatedBy';
export interface ChangeRequestCommentSchema {
text: string;
createdBy: ChangeRequestCommentSchemaCreatedBy;
createdAt: string;
}

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestCommentSchemaCreatedBy = {
username?: string | null;
imageUrl?: string | null;
};

View File

@ -0,0 +1,9 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestEnvironmentConfigSchema } from './changeRequestEnvironmentConfigSchema';
export type ChangeRequestConfigSchema = ChangeRequestEnvironmentConfigSchema[];

View File

@ -0,0 +1,24 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestCreateSchemaOneOf } from './changeRequestCreateSchemaOneOf';
import type { ChangeRequestCreateSchemaOneOfThree } from './changeRequestCreateSchemaOneOfThree';
import type { ChangeRequestCreateSchemaOneOfFour } from './changeRequestCreateSchemaOneOfFour';
import type { ChangeRequestCreateSchemaOneOfFive } from './changeRequestCreateSchemaOneOfFive';
export type ChangeRequestCreateSchema =
| (ChangeRequestCreateSchemaOneOf & {
feature: string;
})
| (ChangeRequestCreateSchemaOneOfThree & {
feature: string;
})
| (ChangeRequestCreateSchemaOneOfFour & {
feature: string;
})
| (ChangeRequestCreateSchemaOneOfFive & {
feature: string;
});

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestCreateSchemaOneOfPayload } from './changeRequestCreateSchemaOneOfPayload';
export type ChangeRequestCreateSchemaOneOf = {
action: unknown;
payload: ChangeRequestCreateSchemaOneOfPayload;
};

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestCreateSchemaOneOfFivePayload } from './changeRequestCreateSchemaOneOfFivePayload';
export type ChangeRequestCreateSchemaOneOfFive = {
action: unknown;
payload: ChangeRequestCreateSchemaOneOfFivePayload;
};

View File

@ -0,0 +1,10 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestCreateSchemaOneOfFivePayload = {
id: string;
};

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { UpdateFeatureStrategySchema } from './updateFeatureStrategySchema';
export type ChangeRequestCreateSchemaOneOfFour = {
action: unknown;
payload: UpdateFeatureStrategySchema;
};

View File

@ -0,0 +1,10 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestCreateSchemaOneOfPayload = {
enabled: boolean;
};

View File

@ -0,0 +1,12 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { CreateFeatureStrategySchema } from './createFeatureStrategySchema';
export type ChangeRequestCreateSchemaOneOfThree = {
action: unknown;
payload: CreateFeatureStrategySchema;
};

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export interface ChangeRequestEnvironmentConfigSchema {
environment: string;
type: string;
changeRequestEnabled: boolean;
requiredApprovals: number;
}

View File

@ -0,0 +1,18 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestEventSchemaPayload } from './changeRequestEventSchemaPayload';
import type { ChangeRequestEventSchemaCreatedBy } from './changeRequestEventSchemaCreatedBy';
export interface ChangeRequestEventSchema {
id: number;
action: string;
conflict?: string;
payload: ChangeRequestEventSchemaPayload;
updatedBy?: string;
createdBy?: ChangeRequestEventSchemaCreatedBy;
createdAt?: string;
}

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestEventSchemaCreatedBy = {
username?: string | null;
imageUrl?: string | null;
};

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestEventSchemaPayloadOneOf } from './changeRequestEventSchemaPayloadOneOf';
export type ChangeRequestEventSchemaPayload =
| string
| boolean
| ChangeRequestEventSchemaPayloadOneOf
| number;

View File

@ -0,0 +1,8 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestEventSchemaPayloadOneOf = { [key: string]: any };

View File

@ -0,0 +1,13 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestEventSchema } from './changeRequestEventSchema';
export interface ChangeRequestFeatureSchema {
name: string;
conflict?: string;
changes: ChangeRequestEventSchema[];
}

View File

@ -0,0 +1,24 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
import type { ChangeRequestSchemaState } from './changeRequestSchemaState';
import type { ChangeRequestFeatureSchema } from './changeRequestFeatureSchema';
import type { ChangeRequestApprovalSchema } from './changeRequestApprovalSchema';
import type { ChangeRequestCommentSchema } from './changeRequestCommentSchema';
import type { ChangeRequestSchemaCreatedBy } from './changeRequestSchemaCreatedBy';
export interface ChangeRequestSchema {
id: number;
environment: string;
state: ChangeRequestSchemaState;
minApprovals: number;
project: string;
features: ChangeRequestFeatureSchema[];
approvals?: ChangeRequestApprovalSchema[];
comments?: ChangeRequestCommentSchema[];
createdBy: ChangeRequestSchemaCreatedBy;
createdAt: string;
}

View File

@ -0,0 +1,11 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestSchemaCreatedBy = {
username?: string | null;
imageUrl?: string | null;
};

View File

@ -0,0 +1,18 @@
/**
* Generated by orval v6.10.3 🍺
* Do not edit manually.
* Unleash API
* OpenAPI spec version: 4.20.0-beta.1
*/
export type ChangeRequestSchemaState =
typeof ChangeRequestSchemaState[keyof typeof ChangeRequestSchemaState];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const ChangeRequestSchemaState = {
Draft: 'Draft',
In_review: 'In review',
Approved: 'Approved',
Applied: 'Applied',
Cancelled: 'Cancelled',
} as const;

Some files were not shown because too many files have changed in this diff Show More