From b742a69c4c5aa91af7057bdc7c1e5abd4928df81 Mon Sep 17 00:00:00 2001 From: olav Date: Tue, 24 May 2022 08:37:46 +0200 Subject: [PATCH] refactor: improve OpenAPI refs (#1005) * refactor: regenerate OpenAPI client * refactor: update usage of OpenAPI client --- .../FeatureToggleListItem.tsx | 2 +- .../RedirectFeatureView.tsx | 4 +- .../actions/useFeatureApi/useFeatureApi.ts | 2 +- .../api/getters/useFeatures/useFeatures.ts | 2 +- frontend/src/hooks/useFeaturesFilter.test.ts | 18 +- frontend/src/hooks/useFeaturesFilter.ts | 2 +- frontend/src/hooks/useFeaturesSort.ts | 10 +- frontend/src/openapi/apis/AdminApi.ts | 1069 ++++++++++++++--- .../src/openapi/models/ChangeProjectSchema.ts | 2 +- .../src/openapi/models/CloneFeatureSchema.ts | 64 + .../src/openapi/models/ConstraintSchema.ts | 26 +- .../src/openapi/models/CreateFeatureSchema.ts | 2 +- .../openapi/models/CreateStrategySchema.ts | 24 +- .../models/CreateStrategySchemaConstraints.ts | 96 -- .../models/FeatureEnvironmentSchema.ts | 95 ++ frontend/src/openapi/models/FeatureSchema.ts | 64 +- .../openapi/models/FeatureSchemaOverrides.ts | 64 - .../openapi/models/FeatureSchemaStrategies.ts | 87 -- .../openapi/models/FeatureSchemaVariants.ts | 103 -- .../openapi/models/FeatureStrategySchema.ts | 135 +++ frontend/src/openapi/models/FeaturesSchema.ts | 20 +- .../openapi/models/FeaturesSchemaFeatures.ts | 149 --- frontend/src/openapi/models/OverrideSchema.ts | 2 +- .../openapi/models/PatchOperationSchema.ts | 92 ++ frontend/src/openapi/models/StrategySchema.ts | 36 +- frontend/src/openapi/models/TagSchema.ts | 64 + .../src/openapi/models/TagsResponseSchema.ts | 71 ++ .../src/openapi/models/UpdateFeatureSchema.ts | 119 ++ .../openapi/models/UpdateStrategySchema.ts | 95 ++ frontend/src/openapi/models/VariantSchema.ts | 34 +- .../openapi/models/VariantSchemaPayload.ts | 64 + frontend/src/openapi/models/index.ts | 14 +- frontend/src/openapi/runtime.ts | 2 +- 33 files changed, 1860 insertions(+), 773 deletions(-) create mode 100644 frontend/src/openapi/models/CloneFeatureSchema.ts delete mode 100644 frontend/src/openapi/models/CreateStrategySchemaConstraints.ts create mode 100644 frontend/src/openapi/models/FeatureEnvironmentSchema.ts delete mode 100644 frontend/src/openapi/models/FeatureSchemaOverrides.ts delete mode 100644 frontend/src/openapi/models/FeatureSchemaStrategies.ts delete mode 100644 frontend/src/openapi/models/FeatureSchemaVariants.ts create mode 100644 frontend/src/openapi/models/FeatureStrategySchema.ts delete mode 100644 frontend/src/openapi/models/FeaturesSchemaFeatures.ts create mode 100644 frontend/src/openapi/models/PatchOperationSchema.ts create mode 100644 frontend/src/openapi/models/TagSchema.ts create mode 100644 frontend/src/openapi/models/TagsResponseSchema.ts create mode 100644 frontend/src/openapi/models/UpdateFeatureSchema.ts create mode 100644 frontend/src/openapi/models/UpdateStrategySchema.ts create mode 100644 frontend/src/openapi/models/VariantSchemaPayload.ts diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.tsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.tsx index e2ef7da449..1733d5c274 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.tsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListItem/FeatureToggleListItem.tsx @@ -93,7 +93,7 @@ export const FeatureToggleListItem = memo( condition={!isArchive} show={ { setFeatureToggle(toggle); }, [features, featureId]); - if (!featureToggle) { + if (!featureToggle?.project) { return null; } return ( ); diff --git a/frontend/src/hooks/api/actions/useFeatureApi/useFeatureApi.ts b/frontend/src/hooks/api/actions/useFeatureApi/useFeatureApi.ts index 13a11522da..f3445dc3c2 100644 --- a/frontend/src/hooks/api/actions/useFeatureApi/useFeatureApi.ts +++ b/frontend/src/hooks/api/actions/useFeatureApi/useFeatureApi.ts @@ -41,7 +41,7 @@ const useFeatureApi = () => { projectId: string, createFeatureSchema: CreateFeatureSchema ) => { - return openApiAdmin.apiAdminProjectsProjectIdFeaturesPost({ + return openApiAdmin.createFeature({ projectId, createFeatureSchema, }); diff --git a/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts b/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts index a65dd738fc..9b0cbee967 100644 --- a/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts +++ b/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts @@ -12,7 +12,7 @@ export interface IUseFeaturesOutput { export const useFeatures = (): IUseFeaturesOutput => { const { data, refetch, loading, error } = useApiGetter( 'apiAdminFeaturesGet', - () => openApiAdmin.apiAdminFeaturesGet() + () => openApiAdmin.getAllToggles() ); return { diff --git a/frontend/src/hooks/useFeaturesFilter.test.ts b/frontend/src/hooks/useFeaturesFilter.test.ts index 7f42822370..4ab45440b0 100644 --- a/frontend/src/hooks/useFeaturesFilter.test.ts +++ b/frontend/src/hooks/useFeaturesFilter.test.ts @@ -1,8 +1,12 @@ import { renderHook, act } from '@testing-library/react-hooks'; import { useFeaturesFilter } from 'hooks/useFeaturesFilter'; -import { FeatureSchema, FeatureSchemaStrategies } from 'openapi'; +import { + FeatureSchema, + StrategySchema, + ConstraintSchema, + ConstraintSchemaOperatorEnum, +} from 'openapi'; import parseISO from 'date-fns/parseISO'; -import { IConstraint } from 'interfaces/strategy'; test('useFeaturesFilter empty', () => { const { result } = renderHook(() => useFeaturesFilter([])); @@ -108,8 +112,8 @@ const mockFeatureToggle = ( }; const mockFeatureStrategy = ( - overrides?: Partial -): FeatureSchemaStrategies => { + overrides?: Partial +): StrategySchema => { return { id: '1', name: '1', @@ -119,10 +123,12 @@ const mockFeatureStrategy = ( }; }; -const mockConstraint = (overrides?: Partial): IConstraint => { +const mockConstraint = ( + overrides?: Partial +): ConstraintSchema => { return { contextName: '', - operator: 'IN', + operator: ConstraintSchemaOperatorEnum.In, ...overrides, }; }; diff --git a/frontend/src/hooks/useFeaturesFilter.ts b/frontend/src/hooks/useFeaturesFilter.ts index a1510d71c4..6a92b6395a 100644 --- a/frontend/src/hooks/useFeaturesFilter.ts +++ b/frontend/src/hooks/useFeaturesFilter.ts @@ -104,7 +104,7 @@ const filterFeatureByRegExp = ( return feature.strategies.some( strategy => regExp.test(strategy.name) || - strategy.constraints.some(constraint => + strategy.constraints?.some(constraint => constraint.values?.some(value => regExp.test(value)) ) ); diff --git a/frontend/src/hooks/useFeaturesSort.ts b/frontend/src/hooks/useFeaturesSort.ts index 7dca9bd2cd..ebd77ef02e 100644 --- a/frontend/src/hooks/useFeaturesSort.ts +++ b/frontend/src/hooks/useFeaturesSort.ts @@ -156,7 +156,15 @@ const sortByName = (features: Readonly): FeatureSchema[] => { const sortByProject = ( features: Readonly ): FeatureSchema[] => { - return [...features].sort((a, b) => a.project.localeCompare(b.project)); + return [...features].sort((a, b) => + a.project && b.project + ? a.project.localeCompare(b.project) + : a.project + ? 1 + : b.project + ? -1 + : 0 + ); }; const sortByType = (features: Readonly): FeatureSchema[] => { diff --git a/frontend/src/openapi/apis/AdminApi.ts b/frontend/src/openapi/apis/AdminApi.ts index 09f0e0ef60..2391d854f4 100644 --- a/frontend/src/openapi/apis/AdminApi.ts +++ b/frontend/src/openapi/apis/AdminApi.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,23 +18,59 @@ import { ChangeProjectSchema, ChangeProjectSchemaFromJSON, ChangeProjectSchemaToJSON, + CloneFeatureSchema, + CloneFeatureSchemaFromJSON, + CloneFeatureSchemaToJSON, CreateFeatureSchema, CreateFeatureSchemaFromJSON, CreateFeatureSchemaToJSON, CreateStrategySchema, CreateStrategySchemaFromJSON, CreateStrategySchemaToJSON, + FeatureEnvironmentSchema, + FeatureEnvironmentSchemaFromJSON, + FeatureEnvironmentSchemaToJSON, FeatureSchema, FeatureSchemaFromJSON, FeatureSchemaToJSON, + FeatureStrategySchema, + FeatureStrategySchemaFromJSON, + FeatureStrategySchemaToJSON, FeaturesSchema, FeaturesSchemaFromJSON, FeaturesSchemaToJSON, + PatchOperationSchema, + PatchOperationSchemaFromJSON, + PatchOperationSchemaToJSON, StrategySchema, StrategySchemaFromJSON, StrategySchemaToJSON, + TagSchema, + TagSchemaFromJSON, + TagSchemaToJSON, + TagsResponseSchema, + TagsResponseSchemaFromJSON, + TagsResponseSchemaToJSON, + UpdateFeatureSchema, + UpdateFeatureSchemaFromJSON, + UpdateFeatureSchemaToJSON, + UpdateStrategySchema, + UpdateStrategySchemaFromJSON, + UpdateStrategySchemaToJSON, } from '../models'; +export interface AddStrategyRequest { + projectId: string; + featureName: string; + environment: string; + createStrategySchema: CreateStrategySchema; +} + +export interface AddTagRequest { + featureName: string; + tagSchema: TagSchema; +} + export interface ApiAdminArchiveFeaturesProjectIdGetRequest { projectId: string; } @@ -45,33 +81,105 @@ export interface ApiAdminProjectsProjectIdFeaturesFeatureNameChangeProjectPostRe changeProjectSchema: ChangeProjectSchema; } -export interface ApiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPostRequest { +export interface ArchiveFeatureRequest { projectId: string; featureName: string; - environment: string; - createStrategySchema: CreateStrategySchema; } -export interface ApiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPutRequest { +export interface CloneFeatureRequest { + projectId: string; + featureName: string; + cloneFeatureSchema: CloneFeatureSchema; +} + +export interface CreateFeatureRequest { + projectId: string; + createFeatureSchema: CreateFeatureSchema; +} + +export interface DeleteStrategyRequest { projectId: string; featureName: string; environment: string; strategyId: string; - createStrategySchema: CreateStrategySchema; } -export interface ApiAdminProjectsProjectIdFeaturesFeatureNameGetRequest { +export interface GetEnvironmentRequest { + projectId: string; + featureName: string; + environment: string; +} + +export interface GetFeatureRequest { projectId: string; featureName: string; } -export interface ApiAdminProjectsProjectIdFeaturesGetRequest { +export interface GetFeaturesRequest { projectId: string; } -export interface ApiAdminProjectsProjectIdFeaturesPostRequest { +export interface GetStrategiesRequest { projectId: string; - createFeatureSchema: CreateFeatureSchema; + featureName: string; + environment: string; +} + +export interface GetStrategyRequest { + projectId: string; + featureName: string; + environment: string; + strategyId: string; +} + +export interface ListTagsRequest { + featureName: string; +} + +export interface PatchFeatureRequest { + projectId: string; + featureName: string; + patchOperationSchema: Array; +} + +export interface PatchStrategyRequest { + projectId: string; + featureName: string; + environment: string; + strategyId: string; + patchOperationSchema: Array; +} + +export interface RemoveTagRequest { + featureName: string; + type: string; + value: string; +} + +export interface ToggleEnvironmentOffRequest { + projectId: string; + featureName: string; + environment: string; +} + +export interface ToggleEnvironmentOnRequest { + projectId: string; + featureName: string; + environment: string; +} + +export interface UpdateFeatureRequest { + projectId: string; + featureName: string; + updateFeatureSchema: UpdateFeatureSchema; +} + +export interface UpdateStrategyRequest { + projectId: string; + featureName: string; + environment: string; + strategyId: string; + updateStrategySchema: UpdateStrategySchema; } /** @@ -79,6 +187,92 @@ export interface ApiAdminProjectsProjectIdFeaturesPostRequest { */ export class AdminApi extends runtime.BaseAPI { + /** + */ + async addStrategyRaw(requestParameters: AddStrategyRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling addStrategy.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling addStrategy.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling addStrategy.'); + } + + if (requestParameters.createStrategySchema === null || requestParameters.createStrategySchema === undefined) { + throw new runtime.RequiredError('createStrategySchema','Required parameter requestParameters.createStrategySchema was null or undefined when calling addStrategy.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CreateStrategySchemaToJSON(requestParameters.createStrategySchema), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue)); + } + + /** + */ + async addStrategy(requestParameters: AddStrategyRequest, initOverrides?: RequestInit): Promise { + const response = await this.addStrategyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async addTagRaw(requestParameters: AddTagRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling addTag.'); + } + + if (requestParameters.tagSchema === null || requestParameters.tagSchema === undefined) { + throw new runtime.RequiredError('tagSchema','Required parameter requestParameters.tagSchema was null or undefined when calling addTag.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/features/{featureName}/tags`.replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TagSchemaToJSON(requestParameters.tagSchema), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TagSchemaFromJSON(jsonValue)); + } + + /** + */ + async addTag(requestParameters: AddTagRequest, initOverrides?: RequestInit): Promise { + const response = await this.addTagRaw(requestParameters, initOverrides); + return await response.value(); + } + /** */ async apiAdminArchiveFeaturesGetRaw(initOverrides?: RequestInit): Promise> { @@ -139,34 +333,6 @@ export class AdminApi extends runtime.BaseAPI { return await response.value(); } - /** - */ - async apiAdminFeaturesGetRaw(initOverrides?: RequestInit): Promise> { - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication - } - - const response = await this.request({ - path: `/api/admin/features`, - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue)); - } - - /** - */ - async apiAdminFeaturesGet(initOverrides?: RequestInit): Promise { - const response = await this.apiAdminFeaturesGetRaw(initOverrides); - return await response.value(); - } - /** */ async apiAdminProjectsProjectIdFeaturesFeatureNameChangeProjectPostRaw(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameChangeProjectPostRequest, initOverrides?: RequestInit): Promise> { @@ -211,111 +377,13 @@ export class AdminApi extends runtime.BaseAPI { /** */ - async apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPostRaw(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPostRequest, initOverrides?: RequestInit): Promise> { + async archiveFeatureRaw(requestParameters: ArchiveFeatureRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { - throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPost.'); + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling archiveFeature.'); } if (requestParameters.featureName === null || requestParameters.featureName === undefined) { - throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPost.'); - } - - if (requestParameters.environment === null || requestParameters.environment === undefined) { - throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPost.'); - } - - if (requestParameters.createStrategySchema === null || requestParameters.createStrategySchema === undefined) { - throw new runtime.RequiredError('createStrategySchema','Required parameter requestParameters.createStrategySchema was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPost.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication - } - - const response = await this.request({ - path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))), - method: 'POST', - headers: headerParameters, - query: queryParameters, - body: CreateStrategySchemaToJSON(requestParameters.createStrategySchema), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => StrategySchemaFromJSON(jsonValue)); - } - - /** - */ - async apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPost(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPostRequest, initOverrides?: RequestInit): Promise { - const response = await this.apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesPostRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - */ - async apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPutRaw(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPutRequest, initOverrides?: RequestInit): Promise> { - if (requestParameters.projectId === null || requestParameters.projectId === undefined) { - throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPut.'); - } - - if (requestParameters.featureName === null || requestParameters.featureName === undefined) { - throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPut.'); - } - - if (requestParameters.environment === null || requestParameters.environment === undefined) { - throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPut.'); - } - - if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) { - throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPut.'); - } - - if (requestParameters.createStrategySchema === null || requestParameters.createStrategySchema === undefined) { - throw new runtime.RequiredError('createStrategySchema','Required parameter requestParameters.createStrategySchema was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPut.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - headerParameters['Content-Type'] = 'application/json'; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication - } - - const response = await this.request({ - path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))), - method: 'PUT', - headers: headerParameters, - query: queryParameters, - body: CreateStrategySchemaToJSON(requestParameters.createStrategySchema), - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => StrategySchemaFromJSON(jsonValue)); - } - - /** - */ - async apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPut(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPutRequest, initOverrides?: RequestInit): Promise { - const response = await this.apiAdminProjectsProjectIdFeaturesFeatureNameEnvironmentsEnvironmentStrategiesStrategyIdPutRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - */ - async apiAdminProjectsProjectIdFeaturesFeatureNameGetRaw(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameGetRequest, initOverrides?: RequestInit): Promise> { - if (requestParameters.projectId === null || requestParameters.projectId === undefined) { - throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameGet.'); - } - - if (requestParameters.featureName === null || requestParameters.featureName === undefined) { - throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling apiAdminProjectsProjectIdFeaturesFeatureNameGet.'); + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling archiveFeature.'); } const queryParameters: any = {}; @@ -328,62 +396,73 @@ export class AdminApi extends runtime.BaseAPI { const response = await this.request({ path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), - method: 'GET', + method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); + return new runtime.JSONApiResponse(response); + } + + /** + */ + async archiveFeature(requestParameters: ArchiveFeatureRequest, initOverrides?: RequestInit): Promise { + const response = await this.archiveFeatureRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async cloneFeatureRaw(requestParameters: CloneFeatureRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling cloneFeature.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling cloneFeature.'); + } + + if (requestParameters.cloneFeatureSchema === null || requestParameters.cloneFeatureSchema === undefined) { + throw new runtime.RequiredError('cloneFeatureSchema','Required parameter requestParameters.cloneFeatureSchema was null or undefined when calling cloneFeature.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/clone`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CloneFeatureSchemaToJSON(requestParameters.cloneFeatureSchema), + }, initOverrides); + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue)); } /** */ - async apiAdminProjectsProjectIdFeaturesFeatureNameGet(requestParameters: ApiAdminProjectsProjectIdFeaturesFeatureNameGetRequest, initOverrides?: RequestInit): Promise { - const response = await this.apiAdminProjectsProjectIdFeaturesFeatureNameGetRaw(requestParameters, initOverrides); + async cloneFeature(requestParameters: CloneFeatureRequest, initOverrides?: RequestInit): Promise { + const response = await this.cloneFeatureRaw(requestParameters, initOverrides); return await response.value(); } /** */ - async apiAdminProjectsProjectIdFeaturesGetRaw(requestParameters: ApiAdminProjectsProjectIdFeaturesGetRequest, initOverrides?: RequestInit): Promise> { + async createFeatureRaw(requestParameters: CreateFeatureRequest, initOverrides?: RequestInit): Promise> { if (requestParameters.projectId === null || requestParameters.projectId === undefined) { - throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling apiAdminProjectsProjectIdFeaturesGet.'); - } - - const queryParameters: any = {}; - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication - } - - const response = await this.request({ - path: `/api/admin/projects/{projectId}/features`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue)); - } - - /** - */ - async apiAdminProjectsProjectIdFeaturesGet(requestParameters: ApiAdminProjectsProjectIdFeaturesGetRequest, initOverrides?: RequestInit): Promise { - const response = await this.apiAdminProjectsProjectIdFeaturesGetRaw(requestParameters, initOverrides); - return await response.value(); - } - - /** - */ - async apiAdminProjectsProjectIdFeaturesPostRaw(requestParameters: ApiAdminProjectsProjectIdFeaturesPostRequest, initOverrides?: RequestInit): Promise> { - if (requestParameters.projectId === null || requestParameters.projectId === undefined) { - throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling apiAdminProjectsProjectIdFeaturesPost.'); + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling createFeature.'); } if (requestParameters.createFeatureSchema === null || requestParameters.createFeatureSchema === undefined) { - throw new runtime.RequiredError('createFeatureSchema','Required parameter requestParameters.createFeatureSchema was null or undefined when calling apiAdminProjectsProjectIdFeaturesPost.'); + throw new runtime.RequiredError('createFeatureSchema','Required parameter requestParameters.createFeatureSchema was null or undefined when calling createFeature.'); } const queryParameters: any = {}; @@ -409,8 +488,640 @@ export class AdminApi extends runtime.BaseAPI { /** */ - async apiAdminProjectsProjectIdFeaturesPost(requestParameters: ApiAdminProjectsProjectIdFeaturesPostRequest, initOverrides?: RequestInit): Promise { - const response = await this.apiAdminProjectsProjectIdFeaturesPostRaw(requestParameters, initOverrides); + async createFeature(requestParameters: CreateFeatureRequest, initOverrides?: RequestInit): Promise { + const response = await this.createFeatureRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async deleteStrategyRaw(requestParameters: DeleteStrategyRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling deleteStrategy.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling deleteStrategy.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling deleteStrategy.'); + } + + if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) { + throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling deleteStrategy.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + */ + async deleteStrategy(requestParameters: DeleteStrategyRequest, initOverrides?: RequestInit): Promise { + const response = await this.deleteStrategyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async getAllTogglesRaw(initOverrides?: RequestInit): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/features`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue)); + } + + /** + */ + async getAllToggles(initOverrides?: RequestInit): Promise { + const response = await this.getAllTogglesRaw(initOverrides); + return await response.value(); + } + + /** + */ + async getEnvironmentRaw(requestParameters: GetEnvironmentRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getEnvironment.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getEnvironment.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling getEnvironment.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureEnvironmentSchemaFromJSON(jsonValue)); + } + + /** + */ + async getEnvironment(requestParameters: GetEnvironmentRequest, initOverrides?: RequestInit): Promise { + const response = await this.getEnvironmentRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async getFeatureRaw(requestParameters: GetFeatureRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getFeature.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getFeature.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue)); + } + + /** + */ + async getFeature(requestParameters: GetFeatureRequest, initOverrides?: RequestInit): Promise { + const response = await this.getFeatureRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async getFeaturesRaw(requestParameters: GetFeaturesRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getFeatures.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeaturesSchemaFromJSON(jsonValue)); + } + + /** + */ + async getFeatures(requestParameters: GetFeaturesRequest, initOverrides?: RequestInit): Promise { + const response = await this.getFeaturesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async getStrategiesRaw(requestParameters: GetStrategiesRequest, initOverrides?: RequestInit): Promise>> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getStrategies.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getStrategies.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling getStrategies.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(StrategySchemaFromJSON)); + } + + /** + */ + async getStrategies(requestParameters: GetStrategiesRequest, initOverrides?: RequestInit): Promise> { + const response = await this.getStrategiesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async getStrategyRaw(requestParameters: GetStrategyRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling getStrategy.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling getStrategy.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling getStrategy.'); + } + + if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) { + throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling getStrategy.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue)); + } + + /** + */ + async getStrategy(requestParameters: GetStrategyRequest, initOverrides?: RequestInit): Promise { + const response = await this.getStrategyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async listTagsRaw(requestParameters: ListTagsRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling listTags.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/features/{featureName}/tags`.replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => TagsResponseSchemaFromJSON(jsonValue)); + } + + /** + */ + async listTags(requestParameters: ListTagsRequest, initOverrides?: RequestInit): Promise { + const response = await this.listTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async patchFeatureRaw(requestParameters: PatchFeatureRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling patchFeature.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling patchFeature.'); + } + + if (requestParameters.patchOperationSchema === null || requestParameters.patchOperationSchema === undefined) { + throw new runtime.RequiredError('patchOperationSchema','Required parameter requestParameters.patchOperationSchema was null or undefined when calling patchFeature.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.patchOperationSchema.map(PatchOperationSchemaToJSON), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue)); + } + + /** + */ + async patchFeature(requestParameters: PatchFeatureRequest, initOverrides?: RequestInit): Promise { + const response = await this.patchFeatureRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async patchStrategyRaw(requestParameters: PatchStrategyRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling patchStrategy.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling patchStrategy.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling patchStrategy.'); + } + + if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) { + throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling patchStrategy.'); + } + + if (requestParameters.patchOperationSchema === null || requestParameters.patchOperationSchema === undefined) { + throw new runtime.RequiredError('patchOperationSchema','Required parameter requestParameters.patchOperationSchema was null or undefined when calling patchStrategy.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))), + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: requestParameters.patchOperationSchema.map(PatchOperationSchemaToJSON), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue)); + } + + /** + */ + async patchStrategy(requestParameters: PatchStrategyRequest, initOverrides?: RequestInit): Promise { + const response = await this.patchStrategyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async removeTagRaw(requestParameters: RemoveTagRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling removeTag.'); + } + + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling removeTag.'); + } + + if (requestParameters.value === null || requestParameters.value === undefined) { + throw new runtime.RequiredError('value','Required parameter requestParameters.value was null or undefined when calling removeTag.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/features/{featureName}/tags/{type}/{value}`.replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"type"}}`, encodeURIComponent(String(requestParameters.type))).replace(`{${"value"}}`, encodeURIComponent(String(requestParameters.value))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + */ + async removeTag(requestParameters: RemoveTagRequest, initOverrides?: RequestInit): Promise { + const response = await this.removeTagRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async toggleEnvironmentOffRaw(requestParameters: ToggleEnvironmentOffRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling toggleEnvironmentOff.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling toggleEnvironmentOff.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling toggleEnvironmentOff.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/off`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue)); + } + + /** + */ + async toggleEnvironmentOff(requestParameters: ToggleEnvironmentOffRequest, initOverrides?: RequestInit): Promise { + const response = await this.toggleEnvironmentOffRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async toggleEnvironmentOnRaw(requestParameters: ToggleEnvironmentOnRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling toggleEnvironmentOn.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling toggleEnvironmentOn.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling toggleEnvironmentOn.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/on`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue)); + } + + /** + */ + async toggleEnvironmentOn(requestParameters: ToggleEnvironmentOnRequest, initOverrides?: RequestInit): Promise { + const response = await this.toggleEnvironmentOnRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async updateFeatureRaw(requestParameters: UpdateFeatureRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling updateFeature.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling updateFeature.'); + } + + if (requestParameters.updateFeatureSchema === null || requestParameters.updateFeatureSchema === undefined) { + throw new runtime.RequiredError('updateFeatureSchema','Required parameter requestParameters.updateFeatureSchema was null or undefined when calling updateFeature.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UpdateFeatureSchemaToJSON(requestParameters.updateFeatureSchema), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSchemaFromJSON(jsonValue)); + } + + /** + */ + async updateFeature(requestParameters: UpdateFeatureRequest, initOverrides?: RequestInit): Promise { + const response = await this.updateFeatureRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async updateStrategyRaw(requestParameters: UpdateStrategyRequest, initOverrides?: RequestInit): Promise> { + if (requestParameters.projectId === null || requestParameters.projectId === undefined) { + throw new runtime.RequiredError('projectId','Required parameter requestParameters.projectId was null or undefined when calling updateStrategy.'); + } + + if (requestParameters.featureName === null || requestParameters.featureName === undefined) { + throw new runtime.RequiredError('featureName','Required parameter requestParameters.featureName was null or undefined when calling updateStrategy.'); + } + + if (requestParameters.environment === null || requestParameters.environment === undefined) { + throw new runtime.RequiredError('environment','Required parameter requestParameters.environment was null or undefined when calling updateStrategy.'); + } + + if (requestParameters.strategyId === null || requestParameters.strategyId === undefined) { + throw new runtime.RequiredError('strategyId','Required parameter requestParameters.strategyId was null or undefined when calling updateStrategy.'); + } + + if (requestParameters.updateStrategySchema === null || requestParameters.updateStrategySchema === undefined) { + throw new runtime.RequiredError('updateStrategySchema','Required parameter requestParameters.updateStrategySchema was null or undefined when calling updateStrategy.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/strategies/{strategyId}`.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters.projectId))).replace(`{${"featureName"}}`, encodeURIComponent(String(requestParameters.featureName))).replace(`{${"environment"}}`, encodeURIComponent(String(requestParameters.environment))).replace(`{${"strategyId"}}`, encodeURIComponent(String(requestParameters.strategyId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UpdateStrategySchemaToJSON(requestParameters.updateStrategySchema), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FeatureStrategySchemaFromJSON(jsonValue)); + } + + /** + */ + async updateStrategy(requestParameters: UpdateStrategyRequest, initOverrides?: RequestInit): Promise { + const response = await this.updateStrategyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + */ + async validateFeatureRaw(initOverrides?: RequestInit): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // apiKey authentication + } + + const response = await this.request({ + path: `/api/admin/features/validate`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + */ + async validateFeature(initOverrides?: RequestInit): Promise { + const response = await this.validateFeatureRaw(initOverrides); return await response.value(); } diff --git a/frontend/src/openapi/models/ChangeProjectSchema.ts b/frontend/src/openapi/models/ChangeProjectSchema.ts index 3a8d409fd7..808d15eb7d 100644 --- a/frontend/src/openapi/models/ChangeProjectSchema.ts +++ b/frontend/src/openapi/models/ChangeProjectSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/frontend/src/openapi/models/CloneFeatureSchema.ts b/frontend/src/openapi/models/CloneFeatureSchema.ts new file mode 100644 index 0000000000..c57221dc0d --- /dev/null +++ b/frontend/src/openapi/models/CloneFeatureSchema.ts @@ -0,0 +1,64 @@ +/* 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, + }; +} + diff --git a/frontend/src/openapi/models/ConstraintSchema.ts b/frontend/src/openapi/models/ConstraintSchema.ts index e613702b91..bdd882f095 100644 --- a/frontend/src/openapi/models/ConstraintSchema.ts +++ b/frontend/src/openapi/models/ConstraintSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,7 +30,7 @@ export interface ConstraintSchema { * @type {string} * @memberof ConstraintSchema */ - operator: string; + operator: ConstraintSchemaOperatorEnum; /** * * @type {boolean} @@ -57,6 +57,28 @@ export interface ConstraintSchema { value?: string; } +/** +* @export +* @enum {string} +*/ +export enum 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' +} + export function ConstraintSchemaFromJSON(json: any): ConstraintSchema { return ConstraintSchemaFromJSONTyped(json, false); } diff --git a/frontend/src/openapi/models/CreateFeatureSchema.ts b/frontend/src/openapi/models/CreateFeatureSchema.ts index 56cd6a0d9c..623fdbda11 100644 --- a/frontend/src/openapi/models/CreateFeatureSchema.ts +++ b/frontend/src/openapi/models/CreateFeatureSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/frontend/src/openapi/models/CreateStrategySchema.ts b/frontend/src/openapi/models/CreateStrategySchema.ts index a2390c31e5..5d53b30a1c 100644 --- a/frontend/src/openapi/models/CreateStrategySchema.ts +++ b/frontend/src/openapi/models/CreateStrategySchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,11 +14,11 @@ import { exists, mapValues } from '../runtime'; import { - CreateStrategySchemaConstraints, - CreateStrategySchemaConstraintsFromJSON, - CreateStrategySchemaConstraintsFromJSONTyped, - CreateStrategySchemaConstraintsToJSON, -} from './CreateStrategySchemaConstraints'; + ConstraintSchema, + ConstraintSchemaFromJSON, + ConstraintSchemaFromJSONTyped, + ConstraintSchemaToJSON, +} from './ConstraintSchema'; /** * @@ -31,7 +31,7 @@ export interface CreateStrategySchema { * @type {string} * @memberof CreateStrategySchema */ - name?: string; + name: string; /** * * @type {number} @@ -40,10 +40,10 @@ export interface CreateStrategySchema { sortOrder?: number; /** * - * @type {Array} + * @type {Array} * @memberof CreateStrategySchema */ - constraints?: Array; + constraints?: Array; /** * * @type {{ [key: string]: string; }} @@ -62,9 +62,9 @@ export function CreateStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator } return { - 'name': !exists(json, 'name') ? undefined : json['name'], + 'name': json['name'], 'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'], - 'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array).map(CreateStrategySchemaConstraintsFromJSON)), + 'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array).map(ConstraintSchemaFromJSON)), 'parameters': !exists(json, 'parameters') ? undefined : json['parameters'], }; } @@ -80,7 +80,7 @@ export function CreateStrategySchemaToJSON(value?: CreateStrategySchema | null): 'name': value.name, 'sortOrder': value.sortOrder, - 'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array).map(CreateStrategySchemaConstraintsToJSON)), + 'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array).map(ConstraintSchemaToJSON)), 'parameters': value.parameters, }; } diff --git a/frontend/src/openapi/models/CreateStrategySchemaConstraints.ts b/frontend/src/openapi/models/CreateStrategySchemaConstraints.ts deleted file mode 100644 index 1a3022d0f5..0000000000 --- a/frontend/src/openapi/models/CreateStrategySchemaConstraints.ts +++ /dev/null @@ -1,96 +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.10.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 CreateStrategySchemaConstraints - */ -export interface CreateStrategySchemaConstraints { - /** - * - * @type {string} - * @memberof CreateStrategySchemaConstraints - */ - contextName: string; - /** - * - * @type {string} - * @memberof CreateStrategySchemaConstraints - */ - operator: string; - /** - * - * @type {boolean} - * @memberof CreateStrategySchemaConstraints - */ - caseInsensitive?: boolean; - /** - * - * @type {boolean} - * @memberof CreateStrategySchemaConstraints - */ - inverted?: boolean; - /** - * - * @type {Array} - * @memberof CreateStrategySchemaConstraints - */ - values?: Array; - /** - * - * @type {string} - * @memberof CreateStrategySchemaConstraints - */ - value?: string; -} - -export function CreateStrategySchemaConstraintsFromJSON(json: any): CreateStrategySchemaConstraints { - return CreateStrategySchemaConstraintsFromJSONTyped(json, false); -} - -export function CreateStrategySchemaConstraintsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateStrategySchemaConstraints { - 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 CreateStrategySchemaConstraintsToJSON(value?: CreateStrategySchemaConstraints | 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, - }; -} - diff --git a/frontend/src/openapi/models/FeatureEnvironmentSchema.ts b/frontend/src/openapi/models/FeatureEnvironmentSchema.ts new file mode 100644 index 0000000000..eb440d95ec --- /dev/null +++ b/frontend/src/openapi/models/FeatureEnvironmentSchema.ts @@ -0,0 +1,95 @@ +/* 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} + * @memberof FeatureEnvironmentSchema + */ + strategies?: Array; +} + +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).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).map(FeatureStrategySchemaToJSON)), + }; +} + diff --git a/frontend/src/openapi/models/FeatureSchema.ts b/frontend/src/openapi/models/FeatureSchema.ts index 2edf440106..259c087a74 100644 --- a/frontend/src/openapi/models/FeatureSchema.ts +++ b/frontend/src/openapi/models/FeatureSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,17 +14,23 @@ import { exists, mapValues } from '../runtime'; import { - FeatureSchemaStrategies, - FeatureSchemaStrategiesFromJSON, - FeatureSchemaStrategiesFromJSONTyped, - FeatureSchemaStrategiesToJSON, -} from './FeatureSchemaStrategies'; + FeatureEnvironmentSchema, + FeatureEnvironmentSchemaFromJSON, + FeatureEnvironmentSchemaFromJSONTyped, + FeatureEnvironmentSchemaToJSON, +} from './FeatureEnvironmentSchema'; import { - FeatureSchemaVariants, - FeatureSchemaVariantsFromJSON, - FeatureSchemaVariantsFromJSONTyped, - FeatureSchemaVariantsToJSON, -} from './FeatureSchemaVariants'; + StrategySchema, + StrategySchemaFromJSON, + StrategySchemaFromJSONTyped, + StrategySchemaToJSON, +} from './StrategySchema'; +import { + VariantSchema, + VariantSchemaFromJSON, + VariantSchemaFromJSONTyped, + VariantSchemaToJSON, +} from './VariantSchema'; /** * @@ -50,12 +56,18 @@ export interface FeatureSchema { * @memberof FeatureSchema */ description?: string; + /** + * + * @type {boolean} + * @memberof FeatureSchema + */ + archived?: boolean; /** * * @type {string} * @memberof FeatureSchema */ - project: string; + project?: string; /** * * @type {boolean} @@ -88,16 +100,22 @@ export interface FeatureSchema { lastSeenAt?: Date | null; /** * - * @type {Array} + * @type {Array} * @memberof FeatureSchema */ - strategies?: Array; + environments?: Array; /** * - * @type {Array} + * @type {Array} * @memberof FeatureSchema */ - variants?: Array; + strategies?: Array; + /** + * + * @type {Array} + * @memberof FeatureSchema + */ + variants?: Array; } export function FeatureSchemaFromJSON(json: any): FeatureSchema { @@ -113,14 +131,16 @@ export function FeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boole 'name': json['name'], 'type': !exists(json, 'type') ? undefined : json['type'], 'description': !exists(json, 'description') ? undefined : json['description'], - 'project': json['project'], + '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'])), 'lastSeenAt': !exists(json, 'lastSeenAt') ? undefined : (json['lastSeenAt'] === null ? null : new Date(json['lastSeenAt'])), - 'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array).map(FeatureSchemaStrategiesFromJSON)), - 'variants': !exists(json, 'variants') ? undefined : ((json['variants'] as Array).map(FeatureSchemaVariantsFromJSON)), + 'environments': !exists(json, 'environments') ? undefined : ((json['environments'] as Array).map(FeatureEnvironmentSchemaFromJSON)), + 'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array).map(StrategySchemaFromJSON)), + 'variants': !exists(json, 'variants') ? undefined : ((json['variants'] as Array).map(VariantSchemaFromJSON)), }; } @@ -136,14 +156,16 @@ export function FeatureSchemaToJSON(value?: FeatureSchema | null): any { '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)), 'lastSeenAt': value.lastSeenAt === undefined ? undefined : (value.lastSeenAt === null ? null : value.lastSeenAt.toISOString().substr(0,10)), - 'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array).map(FeatureSchemaStrategiesToJSON)), - 'variants': value.variants === undefined ? undefined : ((value.variants as Array).map(FeatureSchemaVariantsToJSON)), + 'environments': value.environments === undefined ? undefined : ((value.environments as Array).map(FeatureEnvironmentSchemaToJSON)), + 'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array).map(StrategySchemaToJSON)), + 'variants': value.variants === undefined ? undefined : ((value.variants as Array).map(VariantSchemaToJSON)), }; } diff --git a/frontend/src/openapi/models/FeatureSchemaOverrides.ts b/frontend/src/openapi/models/FeatureSchemaOverrides.ts deleted file mode 100644 index d7465adaee..0000000000 --- a/frontend/src/openapi/models/FeatureSchemaOverrides.ts +++ /dev/null @@ -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.10.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 FeatureSchemaOverrides - */ -export interface FeatureSchemaOverrides { - /** - * - * @type {string} - * @memberof FeatureSchemaOverrides - */ - contextName: string; - /** - * - * @type {Array} - * @memberof FeatureSchemaOverrides - */ - values: Array; -} - -export function FeatureSchemaOverridesFromJSON(json: any): FeatureSchemaOverrides { - return FeatureSchemaOverridesFromJSONTyped(json, false); -} - -export function FeatureSchemaOverridesFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureSchemaOverrides { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'contextName': json['contextName'], - 'values': json['values'], - }; -} - -export function FeatureSchemaOverridesToJSON(value?: FeatureSchemaOverrides | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'contextName': value.contextName, - 'values': value.values, - }; -} - diff --git a/frontend/src/openapi/models/FeatureSchemaStrategies.ts b/frontend/src/openapi/models/FeatureSchemaStrategies.ts deleted file mode 100644 index 043d645a2b..0000000000 --- a/frontend/src/openapi/models/FeatureSchemaStrategies.ts +++ /dev/null @@ -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.10.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 { - CreateStrategySchemaConstraints, - CreateStrategySchemaConstraintsFromJSON, - CreateStrategySchemaConstraintsFromJSONTyped, - CreateStrategySchemaConstraintsToJSON, -} from './CreateStrategySchemaConstraints'; - -/** - * - * @export - * @interface FeatureSchemaStrategies - */ -export interface FeatureSchemaStrategies { - /** - * - * @type {string} - * @memberof FeatureSchemaStrategies - */ - id: string; - /** - * - * @type {string} - * @memberof FeatureSchemaStrategies - */ - name: string; - /** - * - * @type {Array} - * @memberof FeatureSchemaStrategies - */ - constraints: Array; - /** - * - * @type {{ [key: string]: string; }} - * @memberof FeatureSchemaStrategies - */ - parameters: { [key: string]: string; }; -} - -export function FeatureSchemaStrategiesFromJSON(json: any): FeatureSchemaStrategies { - return FeatureSchemaStrategiesFromJSONTyped(json, false); -} - -export function FeatureSchemaStrategiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureSchemaStrategies { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'id': json['id'], - 'name': json['name'], - 'constraints': ((json['constraints'] as Array).map(CreateStrategySchemaConstraintsFromJSON)), - 'parameters': json['parameters'], - }; -} - -export function FeatureSchemaStrategiesToJSON(value?: FeatureSchemaStrategies | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'id': value.id, - 'name': value.name, - 'constraints': ((value.constraints as Array).map(CreateStrategySchemaConstraintsToJSON)), - 'parameters': value.parameters, - }; -} - diff --git a/frontend/src/openapi/models/FeatureSchemaVariants.ts b/frontend/src/openapi/models/FeatureSchemaVariants.ts deleted file mode 100644 index a91d60071d..0000000000 --- a/frontend/src/openapi/models/FeatureSchemaVariants.ts +++ /dev/null @@ -1,103 +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.10.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 { - FeatureSchemaOverrides, - FeatureSchemaOverridesFromJSON, - FeatureSchemaOverridesFromJSONTyped, - FeatureSchemaOverridesToJSON, -} from './FeatureSchemaOverrides'; - -/** - * - * @export - * @interface FeatureSchemaVariants - */ -export interface FeatureSchemaVariants { - /** - * - * @type {string} - * @memberof FeatureSchemaVariants - */ - name: string; - /** - * - * @type {number} - * @memberof FeatureSchemaVariants - */ - weight: number; - /** - * - * @type {string} - * @memberof FeatureSchemaVariants - */ - weightType: string; - /** - * - * @type {string} - * @memberof FeatureSchemaVariants - */ - stickiness: string; - /** - * - * @type {object} - * @memberof FeatureSchemaVariants - */ - payload?: object; - /** - * - * @type {Array} - * @memberof FeatureSchemaVariants - */ - overrides?: Array; -} - -export function FeatureSchemaVariantsFromJSON(json: any): FeatureSchemaVariants { - return FeatureSchemaVariantsFromJSONTyped(json, false); -} - -export function FeatureSchemaVariantsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureSchemaVariants { - 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 : json['payload'], - 'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array).map(FeatureSchemaOverridesFromJSON)), - }; -} - -export function FeatureSchemaVariantsToJSON(value?: FeatureSchemaVariants | 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': value.payload, - 'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array).map(FeatureSchemaOverridesToJSON)), - }; -} - diff --git a/frontend/src/openapi/models/FeatureStrategySchema.ts b/frontend/src/openapi/models/FeatureStrategySchema.ts new file mode 100644 index 0000000000..9b698835cd --- /dev/null +++ b/frontend/src/openapi/models/FeatureStrategySchema.ts @@ -0,0 +1,135 @@ +/* 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} + * @memberof FeatureStrategySchema + */ + constraints: Array; + /** + * + * @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).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).map(ConstraintSchemaToJSON)), + 'parameters': value.parameters, + }; +} + diff --git a/frontend/src/openapi/models/FeaturesSchema.ts b/frontend/src/openapi/models/FeaturesSchema.ts index afddb49251..c8d6a2983d 100644 --- a/frontend/src/openapi/models/FeaturesSchema.ts +++ b/frontend/src/openapi/models/FeaturesSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,11 +14,11 @@ import { exists, mapValues } from '../runtime'; import { - FeaturesSchemaFeatures, - FeaturesSchemaFeaturesFromJSON, - FeaturesSchemaFeaturesFromJSONTyped, - FeaturesSchemaFeaturesToJSON, -} from './FeaturesSchemaFeatures'; + FeatureSchema, + FeatureSchemaFromJSON, + FeatureSchemaFromJSONTyped, + FeatureSchemaToJSON, +} from './FeatureSchema'; /** * @@ -34,10 +34,10 @@ export interface FeaturesSchema { version: number; /** * - * @type {Array} + * @type {Array} * @memberof FeaturesSchema */ - features: Array; + features: Array; } export function FeaturesSchemaFromJSON(json: any): FeaturesSchema { @@ -51,7 +51,7 @@ export function FeaturesSchemaFromJSONTyped(json: any, ignoreDiscriminator: bool return { 'version': json['version'], - 'features': ((json['features'] as Array).map(FeaturesSchemaFeaturesFromJSON)), + 'features': ((json['features'] as Array).map(FeatureSchemaFromJSON)), }; } @@ -65,7 +65,7 @@ export function FeaturesSchemaToJSON(value?: FeaturesSchema | null): any { return { 'version': value.version, - 'features': ((value.features as Array).map(FeaturesSchemaFeaturesToJSON)), + 'features': ((value.features as Array).map(FeatureSchemaToJSON)), }; } diff --git a/frontend/src/openapi/models/FeaturesSchemaFeatures.ts b/frontend/src/openapi/models/FeaturesSchemaFeatures.ts deleted file mode 100644 index 17acfb3543..0000000000 --- a/frontend/src/openapi/models/FeaturesSchemaFeatures.ts +++ /dev/null @@ -1,149 +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.10.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 { - FeatureSchemaStrategies, - FeatureSchemaStrategiesFromJSON, - FeatureSchemaStrategiesFromJSONTyped, - FeatureSchemaStrategiesToJSON, -} from './FeatureSchemaStrategies'; -import { - FeatureSchemaVariants, - FeatureSchemaVariantsFromJSON, - FeatureSchemaVariantsFromJSONTyped, - FeatureSchemaVariantsToJSON, -} from './FeatureSchemaVariants'; - -/** - * - * @export - * @interface FeaturesSchemaFeatures - */ -export interface FeaturesSchemaFeatures { - /** - * - * @type {string} - * @memberof FeaturesSchemaFeatures - */ - name: string; - /** - * - * @type {string} - * @memberof FeaturesSchemaFeatures - */ - type?: string; - /** - * - * @type {string} - * @memberof FeaturesSchemaFeatures - */ - description?: string; - /** - * - * @type {string} - * @memberof FeaturesSchemaFeatures - */ - project: string; - /** - * - * @type {boolean} - * @memberof FeaturesSchemaFeatures - */ - enabled?: boolean; - /** - * - * @type {boolean} - * @memberof FeaturesSchemaFeatures - */ - stale?: boolean; - /** - * - * @type {boolean} - * @memberof FeaturesSchemaFeatures - */ - impressionData?: boolean; - /** - * - * @type {Date} - * @memberof FeaturesSchemaFeatures - */ - createdAt?: Date | null; - /** - * - * @type {Date} - * @memberof FeaturesSchemaFeatures - */ - lastSeenAt?: Date | null; - /** - * - * @type {Array} - * @memberof FeaturesSchemaFeatures - */ - strategies?: Array; - /** - * - * @type {Array} - * @memberof FeaturesSchemaFeatures - */ - variants?: Array; -} - -export function FeaturesSchemaFeaturesFromJSON(json: any): FeaturesSchemaFeatures { - return FeaturesSchemaFeaturesFromJSONTyped(json, false); -} - -export function FeaturesSchemaFeaturesFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeaturesSchemaFeatures { - 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'], - 'project': 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'])), - 'lastSeenAt': !exists(json, 'lastSeenAt') ? undefined : (json['lastSeenAt'] === null ? null : new Date(json['lastSeenAt'])), - 'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array).map(FeatureSchemaStrategiesFromJSON)), - 'variants': !exists(json, 'variants') ? undefined : ((json['variants'] as Array).map(FeatureSchemaVariantsFromJSON)), - }; -} - -export function FeaturesSchemaFeaturesToJSON(value?: FeaturesSchemaFeatures | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'name': value.name, - 'type': value.type, - 'description': value.description, - '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)), - 'lastSeenAt': value.lastSeenAt === undefined ? undefined : (value.lastSeenAt === null ? null : value.lastSeenAt.toISOString().substr(0,10)), - 'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array).map(FeatureSchemaStrategiesToJSON)), - 'variants': value.variants === undefined ? undefined : ((value.variants as Array).map(FeatureSchemaVariantsToJSON)), - }; -} - diff --git a/frontend/src/openapi/models/OverrideSchema.ts b/frontend/src/openapi/models/OverrideSchema.ts index 79e006c19d..eab05e1207 100644 --- a/frontend/src/openapi/models/OverrideSchema.ts +++ b/frontend/src/openapi/models/OverrideSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/frontend/src/openapi/models/PatchOperationSchema.ts b/frontend/src/openapi/models/PatchOperationSchema.ts new file mode 100644 index 0000000000..9b52f34d63 --- /dev/null +++ b/frontend/src/openapi/models/PatchOperationSchema.ts @@ -0,0 +1,92 @@ +/* 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 +* @enum {string} +*/ +export enum PatchOperationSchemaOpEnum { + Add = 'add', + Remove = 'remove', + Replace = 'replace', + Copy = 'copy', + Move = 'move' +} + +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, + }; +} + diff --git a/frontend/src/openapi/models/StrategySchema.ts b/frontend/src/openapi/models/StrategySchema.ts index 494a7a788c..2b10845640 100644 --- a/frontend/src/openapi/models/StrategySchema.ts +++ b/frontend/src/openapi/models/StrategySchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,11 +14,11 @@ import { exists, mapValues } from '../runtime'; import { - CreateStrategySchemaConstraints, - CreateStrategySchemaConstraintsFromJSON, - CreateStrategySchemaConstraintsFromJSONTyped, - CreateStrategySchemaConstraintsToJSON, -} from './CreateStrategySchemaConstraints'; + ConstraintSchema, + ConstraintSchemaFromJSON, + ConstraintSchemaFromJSONTyped, + ConstraintSchemaToJSON, +} from './ConstraintSchema'; /** * @@ -31,7 +31,7 @@ export interface StrategySchema { * @type {string} * @memberof StrategySchema */ - id: string; + id?: string; /** * * @type {string} @@ -40,16 +40,22 @@ export interface StrategySchema { name: string; /** * - * @type {Array} + * @type {number} * @memberof StrategySchema */ - constraints: Array; + sortOrder?: number; + /** + * + * @type {Array} + * @memberof StrategySchema + */ + constraints?: Array; /** * * @type {{ [key: string]: string; }} * @memberof StrategySchema */ - parameters: { [key: string]: string; }; + parameters?: { [key: string]: string; }; } export function StrategySchemaFromJSON(json: any): StrategySchema { @@ -62,10 +68,11 @@ export function StrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: bool } return { - 'id': json['id'], + 'id': !exists(json, 'id') ? undefined : json['id'], 'name': json['name'], - 'constraints': ((json['constraints'] as Array).map(CreateStrategySchemaConstraintsFromJSON)), - 'parameters': json['parameters'], + 'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'], + 'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array).map(ConstraintSchemaFromJSON)), + 'parameters': !exists(json, 'parameters') ? undefined : json['parameters'], }; } @@ -80,7 +87,8 @@ export function StrategySchemaToJSON(value?: StrategySchema | null): any { 'id': value.id, 'name': value.name, - 'constraints': ((value.constraints as Array).map(CreateStrategySchemaConstraintsToJSON)), + 'sortOrder': value.sortOrder, + 'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array).map(ConstraintSchemaToJSON)), 'parameters': value.parameters, }; } diff --git a/frontend/src/openapi/models/TagSchema.ts b/frontend/src/openapi/models/TagSchema.ts new file mode 100644 index 0000000000..c01e7e097f --- /dev/null +++ b/frontend/src/openapi/models/TagSchema.ts @@ -0,0 +1,64 @@ +/* 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, + }; +} + diff --git a/frontend/src/openapi/models/TagsResponseSchema.ts b/frontend/src/openapi/models/TagsResponseSchema.ts new file mode 100644 index 0000000000..b6deefc221 --- /dev/null +++ b/frontend/src/openapi/models/TagsResponseSchema.ts @@ -0,0 +1,71 @@ +/* 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} + * @memberof TagsResponseSchema + */ + tags: Array; +} + +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).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).map(TagSchemaToJSON)), + }; +} + diff --git a/frontend/src/openapi/models/UpdateFeatureSchema.ts b/frontend/src/openapi/models/UpdateFeatureSchema.ts new file mode 100644 index 0000000000..afdb9b1bf4 --- /dev/null +++ b/frontend/src/openapi/models/UpdateFeatureSchema.ts @@ -0,0 +1,119 @@ +/* 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} + * @memberof UpdateFeatureSchema + */ + constraints?: Array; +} + +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).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).map(ConstraintSchemaToJSON)), + }; +} + diff --git a/frontend/src/openapi/models/UpdateStrategySchema.ts b/frontend/src/openapi/models/UpdateStrategySchema.ts new file mode 100644 index 0000000000..eae9629569 --- /dev/null +++ b/frontend/src/openapi/models/UpdateStrategySchema.ts @@ -0,0 +1,95 @@ +/* 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} + * @memberof UpdateStrategySchema + */ + constraints?: Array; + /** + * + * @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).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).map(ConstraintSchemaToJSON)), + 'parameters': value.parameters, + }; +} + diff --git a/frontend/src/openapi/models/VariantSchema.ts b/frontend/src/openapi/models/VariantSchema.ts index cee84f811a..7566317755 100644 --- a/frontend/src/openapi/models/VariantSchema.ts +++ b/frontend/src/openapi/models/VariantSchema.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,11 +14,17 @@ import { exists, mapValues } from '../runtime'; import { - FeatureSchemaOverrides, - FeatureSchemaOverridesFromJSON, - FeatureSchemaOverridesFromJSONTyped, - FeatureSchemaOverridesToJSON, -} from './FeatureSchemaOverrides'; + OverrideSchema, + OverrideSchemaFromJSON, + OverrideSchemaFromJSONTyped, + OverrideSchemaToJSON, +} from './OverrideSchema'; +import { + VariantSchemaPayload, + VariantSchemaPayloadFromJSON, + VariantSchemaPayloadFromJSONTyped, + VariantSchemaPayloadToJSON, +} from './VariantSchemaPayload'; /** * @@ -52,16 +58,16 @@ export interface VariantSchema { stickiness: string; /** * - * @type {object} + * @type {VariantSchemaPayload} * @memberof VariantSchema */ - payload?: object; + payload?: VariantSchemaPayload; /** * - * @type {Array} + * @type {Array} * @memberof VariantSchema */ - overrides?: Array; + overrides?: Array; } export function VariantSchemaFromJSON(json: any): VariantSchema { @@ -78,8 +84,8 @@ export function VariantSchemaFromJSONTyped(json: any, ignoreDiscriminator: boole 'weight': json['weight'], 'weightType': json['weightType'], 'stickiness': json['stickiness'], - 'payload': !exists(json, 'payload') ? undefined : json['payload'], - 'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array).map(FeatureSchemaOverridesFromJSON)), + 'payload': !exists(json, 'payload') ? undefined : VariantSchemaPayloadFromJSON(json['payload']), + 'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array).map(OverrideSchemaFromJSON)), }; } @@ -96,8 +102,8 @@ export function VariantSchemaToJSON(value?: VariantSchema | null): any { 'weight': value.weight, 'weightType': value.weightType, 'stickiness': value.stickiness, - 'payload': value.payload, - 'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array).map(FeatureSchemaOverridesToJSON)), + 'payload': VariantSchemaPayloadToJSON(value.payload), + 'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array).map(OverrideSchemaToJSON)), }; } diff --git a/frontend/src/openapi/models/VariantSchemaPayload.ts b/frontend/src/openapi/models/VariantSchemaPayload.ts new file mode 100644 index 0000000000..20e1cf3f9d --- /dev/null +++ b/frontend/src/openapi/models/VariantSchemaPayload.ts @@ -0,0 +1,64 @@ +/* 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, + }; +} + diff --git a/frontend/src/openapi/models/index.ts b/frontend/src/openapi/models/index.ts index 1a61215e02..3acb13a748 100644 --- a/frontend/src/openapi/models/index.ts +++ b/frontend/src/openapi/models/index.ts @@ -1,16 +1,20 @@ /* tslint:disable */ /* eslint-disable */ export * from './ChangeProjectSchema'; +export * from './CloneFeatureSchema'; export * from './ConstraintSchema'; export * from './CreateFeatureSchema'; export * from './CreateStrategySchema'; -export * from './CreateStrategySchemaConstraints'; +export * from './FeatureEnvironmentSchema'; export * from './FeatureSchema'; -export * from './FeatureSchemaOverrides'; -export * from './FeatureSchemaStrategies'; -export * from './FeatureSchemaVariants'; +export * from './FeatureStrategySchema'; export * from './FeaturesSchema'; -export * from './FeaturesSchemaFeatures'; export * from './OverrideSchema'; +export * from './PatchOperationSchema'; export * from './StrategySchema'; +export * from './TagSchema'; +export * from './TagsResponseSchema'; +export * from './UpdateFeatureSchema'; +export * from './UpdateStrategySchema'; export * from './VariantSchema'; +export * from './VariantSchemaPayload'; diff --git a/frontend/src/openapi/runtime.ts b/frontend/src/openapi/runtime.ts index 212487a155..2be7bb9eb9 100644 --- a/frontend/src/openapi/runtime.ts +++ b/frontend/src/openapi/runtime.ts @@ -4,7 +4,7 @@ * Unleash API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 4.10.0 + * The version of the OpenAPI document: 4.11.0-beta.2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).