2022-04-25 14:17:59 +02:00
|
|
|
import { OpenAPIV3 } from 'openapi-types';
|
2022-06-17 21:35:26 +02:00
|
|
|
import { apiTokenSchema } from './spec/api-token-schema';
|
|
|
|
import { apiTokensSchema } from './spec/api-tokens-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { cloneFeatureSchema } from './spec/clone-feature-schema';
|
Complete open api schemas for project features controller (#1563)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* revert
* revert
* revert
* revert
* revert
* mapper
* revert
* revert
* revert
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* revert
* revert
* add mappers
* add mappers
* fix pr comments
* ignore report.json
* ignore report.json
* Route permission required
Co-authored-by: olav <mail@olav.io>
2022-05-18 15:17:09 +02:00
|
|
|
import { constraintSchema } from './spec/constraint-schema';
|
2022-06-17 11:11:55 +02:00
|
|
|
import { contextFieldSchema } from './spec/context-field-schema';
|
|
|
|
import { contextFieldsSchema } from './spec/context-fields-schema';
|
2022-06-17 21:35:26 +02:00
|
|
|
import { createApiTokenSchema } from './spec/create-api-token-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { createFeatureSchema } from './spec/create-feature-schema';
|
Complete open api schemas for project features controller (#1563)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* revert
* revert
* revert
* revert
* revert
* mapper
* revert
* revert
* revert
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* revert
* revert
* add mappers
* add mappers
* fix pr comments
* ignore report.json
* ignore report.json
* Route permission required
Co-authored-by: olav <mail@olav.io>
2022-05-18 15:17:09 +02:00
|
|
|
import { createStrategySchema } from './spec/create-strategy-schema';
|
2022-06-08 15:31:34 +02:00
|
|
|
import { environmentSchema } from './spec/environment-schema';
|
2022-06-13 11:23:36 +02:00
|
|
|
import { environmentsSchema } from './spec/environments-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { featureEnvironmentSchema } from './spec/feature-environment-schema';
|
Complete open api schemas for project features controller (#1563)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* revert
* revert
* revert
* revert
* revert
* mapper
* revert
* revert
* revert
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* revert
* revert
* add mappers
* add mappers
* fix pr comments
* ignore report.json
* ignore report.json
* Route permission required
Co-authored-by: olav <mail@olav.io>
2022-05-18 15:17:09 +02:00
|
|
|
import { featureSchema } from './spec/feature-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { featureStrategySchema } from './spec/feature-strategy-schema';
|
2022-06-09 13:17:13 +02:00
|
|
|
import { featureTypeSchema } from './spec/feature-type-schema';
|
|
|
|
import { featureTypesSchema } from './spec/feature-types-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { featureVariantsSchema } from './spec/feature-variants-schema';
|
|
|
|
import { featuresSchema } from './spec/features-schema';
|
2022-06-17 08:15:56 +02:00
|
|
|
import { feedbackSchema } from './spec/feedback-schema';
|
2022-06-20 12:22:41 +02:00
|
|
|
import { healthCheckSchema } from './spec/health-check-schema';
|
2022-06-08 15:31:34 +02:00
|
|
|
import { healthOverviewSchema } from './spec/health-overview-schema';
|
|
|
|
import { healthReportSchema } from './spec/health-report-schema';
|
2022-06-17 11:11:55 +02:00
|
|
|
import { legalValueSchema } from './spec/legal-value-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { mapValues } from '../util/map-values';
|
2022-06-17 11:11:55 +02:00
|
|
|
import { nameSchema } from './spec/name-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { omitKeys } from '../util/omit-keys';
|
|
|
|
import { overrideSchema } from './spec/override-schema';
|
Complete open api schemas for project features controller (#1563)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* revert
* revert
* revert
* revert
* revert
* mapper
* revert
* revert
* revert
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* revert
* revert
* add mappers
* add mappers
* fix pr comments
* ignore report.json
* ignore report.json
* Route permission required
Co-authored-by: olav <mail@olav.io>
2022-05-18 15:17:09 +02:00
|
|
|
import { parametersSchema } from './spec/parameters-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { patchSchema } from './spec/patch-schema';
|
|
|
|
import { patchesSchema } from './spec/patches-schema';
|
2022-06-08 15:31:34 +02:00
|
|
|
import { projectEnvironmentSchema } from './spec/project-environment-schema';
|
|
|
|
import { projectSchema } from './spec/project-schema';
|
|
|
|
import { projectsSchema } from './spec/projects-schema';
|
2022-06-13 11:23:36 +02:00
|
|
|
import { sortOrderSchema } from './spec/sort-order-schema';
|
|
|
|
import { splashSchema } from './spec/splash-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { strategySchema } from './spec/strategy-schema';
|
|
|
|
import { tagSchema } from './spec/tag-schema';
|
|
|
|
import { tagsSchema } from './spec/tags-schema';
|
2022-06-17 21:35:26 +02:00
|
|
|
import { tagTypeSchema } from './spec/tag-type-schema';
|
|
|
|
import { tagTypesSchema } from './spec/tag-types-schema';
|
2022-06-08 14:57:39 +02:00
|
|
|
import { uiConfigSchema } from './spec/ui-config-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { updateFeatureSchema } from './spec/update-feature-schema';
|
Complete open api schemas for project features controller (#1563)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* Completed OpenAPI Schemas for ProjectFeatures Controller
Completed OpenAPI Schemas for Feature Controller (tags)
* bug fix
* bug fix
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* fix merge conflicts, some refactoring
* added emptyResponse, patch feature operation schemas and request
* added emptyResponse, patch feature operation schemas and request
* patch strategy
* patch strategy
* update strategy
* update strategy
* fix pr comment
* fix pr comments
* improvements
* added operationId to schema for better generation
* fix pr comment
* fix pr comment
* fix pr comment
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* improvements to generated and dynamic types
* Update response types to use inferred types
* Update addTag response status to 201
* refactor: move schema ref destructuring into createSchemaObject
* made serialize date handle deep objects
* made serialize date handle deep objects
* add `name` to IFeatureStrategy nad fix tests
* fix pr comments
* fix pr comments
* Add types to IAuthRequest
* Sync StrategySchema for FE and BE - into the rabbit hole
* Sync model with OAS spec
* revert
* revert
* revert
* revert
* revert
* mapper
* revert
* revert
* revert
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* remove serialize-dates.ts
* revert
* revert
* add mappers
* add mappers
* fix pr comments
* ignore report.json
* ignore report.json
* Route permission required
Co-authored-by: olav <mail@olav.io>
2022-05-18 15:17:09 +02:00
|
|
|
import { updateStrategySchema } from './spec/update-strategy-schema';
|
2022-06-17 21:35:26 +02:00
|
|
|
import { updateApiTokenSchema } from './spec/update-api-token-schema';
|
|
|
|
import { updateTagTypeSchema } from './spec/update-tag-type-schema';
|
2022-06-17 11:11:55 +02:00
|
|
|
import { upsertContextFieldSchema } from './spec/upsert-context-field-schema';
|
2022-06-17 21:35:26 +02:00
|
|
|
import { validateTagTypeSchema } from './spec/validate-tag-type-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
import { variantSchema } from './spec/variant-schema';
|
|
|
|
import { variantsSchema } from './spec/variants-schema';
|
2022-06-08 14:57:39 +02:00
|
|
|
import { versionSchema } from './spec/version-schema';
|
2022-06-22 12:49:18 +02:00
|
|
|
import { addonSchema } from './spec/addon-schema';
|
|
|
|
import { addonsSchema } from './spec/addons-schema';
|
|
|
|
import { addonParameterSchema } from './spec/addon-parameter-schema';
|
|
|
|
import { addonTypeSchema } from './spec/addon-type-schema';
|
2022-06-21 09:12:40 +02:00
|
|
|
import { applicationSchema } from './spec/application-schema';
|
|
|
|
import { applicationsSchema } from './spec/applications-schema';
|
2022-06-21 08:23:30 +02:00
|
|
|
import { tagWithVersionSchema } from './spec/tag-with-version-schema';
|
2022-06-22 09:09:49 +02:00
|
|
|
import { featureStrategySegmentSchema } from './spec/feature-strategy-segment-schema';
|
|
|
|
import { segmentSchema } from './spec/segment-schema';
|
|
|
|
import { stateSchema } from './spec/state-schema';
|
|
|
|
import { featureTagSchema } from './spec/feature-tag-schema';
|
|
|
|
import { exportParametersSchema } from './spec/export-parameters-schema';
|
2022-06-08 08:01:14 +02:00
|
|
|
|
2022-06-13 11:23:36 +02:00
|
|
|
// All schemas in `openapi/spec` should be listed here.
|
2022-06-08 08:01:14 +02:00
|
|
|
export const schemas = {
|
2022-06-22 12:49:18 +02:00
|
|
|
addonSchema,
|
|
|
|
addonsSchema,
|
|
|
|
addonTypeSchema,
|
|
|
|
addonParameterSchema,
|
2022-06-17 21:35:26 +02:00
|
|
|
apiTokenSchema,
|
|
|
|
apiTokensSchema,
|
2022-06-21 09:12:40 +02:00
|
|
|
applicationSchema,
|
|
|
|
applicationsSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
cloneFeatureSchema,
|
|
|
|
constraintSchema,
|
2022-06-17 11:11:55 +02:00
|
|
|
contextFieldSchema,
|
|
|
|
contextFieldsSchema,
|
2022-06-17 21:35:26 +02:00
|
|
|
createApiTokenSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
createFeatureSchema,
|
|
|
|
createStrategySchema,
|
2022-06-08 15:31:34 +02:00
|
|
|
environmentSchema,
|
2022-06-10 10:04:56 +02:00
|
|
|
environmentsSchema,
|
2022-06-22 09:09:49 +02:00
|
|
|
exportParametersSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
featureEnvironmentSchema,
|
|
|
|
featureSchema,
|
|
|
|
featureStrategySchema,
|
2022-06-22 09:09:49 +02:00
|
|
|
featureStrategySegmentSchema,
|
|
|
|
featureTagSchema,
|
2022-06-09 13:17:13 +02:00
|
|
|
featureTypeSchema,
|
|
|
|
featureTypesSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
featureVariantsSchema,
|
|
|
|
featuresSchema,
|
2022-06-17 08:15:56 +02:00
|
|
|
feedbackSchema,
|
2022-06-20 12:22:41 +02:00
|
|
|
healthCheckSchema,
|
2022-06-08 15:31:34 +02:00
|
|
|
healthOverviewSchema,
|
|
|
|
healthReportSchema,
|
2022-06-17 11:11:55 +02:00
|
|
|
legalValueSchema,
|
|
|
|
nameSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
overrideSchema,
|
|
|
|
parametersSchema,
|
|
|
|
patchSchema,
|
|
|
|
patchesSchema,
|
2022-06-08 15:31:34 +02:00
|
|
|
projectEnvironmentSchema,
|
|
|
|
projectSchema,
|
|
|
|
projectsSchema,
|
2022-06-22 09:09:49 +02:00
|
|
|
segmentSchema,
|
2022-06-10 10:04:56 +02:00
|
|
|
sortOrderSchema,
|
2022-06-10 15:11:07 +02:00
|
|
|
splashSchema,
|
2022-06-22 09:09:49 +02:00
|
|
|
stateSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
strategySchema,
|
|
|
|
tagSchema,
|
2022-06-21 08:23:30 +02:00
|
|
|
tagWithVersionSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
tagsSchema,
|
2022-06-14 09:06:41 +02:00
|
|
|
tagTypeSchema,
|
|
|
|
tagTypesSchema,
|
2022-06-08 14:57:39 +02:00
|
|
|
uiConfigSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
updateFeatureSchema,
|
|
|
|
updateStrategySchema,
|
2022-06-17 21:35:26 +02:00
|
|
|
updateApiTokenSchema,
|
2022-06-14 09:06:41 +02:00
|
|
|
updateTagTypeSchema,
|
2022-06-17 11:11:55 +02:00
|
|
|
upsertContextFieldSchema,
|
2022-06-14 09:06:41 +02:00
|
|
|
validateTagTypeSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
variantSchema,
|
|
|
|
variantsSchema,
|
2022-06-08 14:57:39 +02:00
|
|
|
versionSchema,
|
2022-06-08 08:01:14 +02:00
|
|
|
};
|
|
|
|
|
2022-06-13 11:23:36 +02:00
|
|
|
// Schemas must have an $id property on the form "#/components/schemas/mySchema".
|
|
|
|
export type SchemaId = typeof schemas[keyof typeof schemas]['$id'];
|
|
|
|
|
|
|
|
// Schemas must list all their $refs in `components`, including nested schemas.
|
|
|
|
export type SchemaRef = typeof schemas[keyof typeof schemas]['components'];
|
|
|
|
|
|
|
|
// JSON schema properties that should not be included in the OpenAPI spec.
|
|
|
|
export interface JsonSchemaProps {
|
|
|
|
$id: string;
|
|
|
|
components: object;
|
|
|
|
}
|
|
|
|
|
2022-06-20 12:22:41 +02:00
|
|
|
interface ApiOperation<Tag = 'client' | 'admin' | 'other'>
|
2022-06-13 11:23:36 +02:00
|
|
|
extends Omit<OpenAPIV3.OperationObject, 'tags'> {
|
|
|
|
operationId: string;
|
2022-06-20 12:22:41 +02:00
|
|
|
tags: [Tag];
|
2022-06-13 11:23:36 +02:00
|
|
|
}
|
|
|
|
|
2022-06-20 12:22:41 +02:00
|
|
|
export type AdminApiOperation = ApiOperation<'admin'>;
|
|
|
|
export type ClientApiOperation = ApiOperation<'client'>;
|
|
|
|
export type OtherApiOperation = ApiOperation<'other'>;
|
2022-06-13 11:23:36 +02:00
|
|
|
|
2022-06-08 08:01:14 +02:00
|
|
|
export const createRequestSchema = (
|
|
|
|
schemaName: string,
|
|
|
|
): OpenAPIV3.RequestBodyObject => {
|
|
|
|
return {
|
|
|
|
description: schemaName,
|
|
|
|
required: true,
|
|
|
|
content: {
|
|
|
|
'application/json': {
|
|
|
|
schema: {
|
|
|
|
$ref: `#/components/schemas/${schemaName}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export const createResponseSchema = (
|
|
|
|
schemaName: string,
|
|
|
|
): OpenAPIV3.ResponseObject => {
|
|
|
|
return {
|
|
|
|
description: schemaName,
|
|
|
|
content: {
|
|
|
|
'application/json': {
|
|
|
|
schema: {
|
|
|
|
$ref: `#/components/schemas/${schemaName}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
2022-04-25 14:17:59 +02:00
|
|
|
|
2022-06-10 10:04:56 +02:00
|
|
|
// Remove JSONSchema keys that would result in an invalid OpenAPI spec.
|
|
|
|
export const removeJsonSchemaProps = <T extends JsonSchemaProps>(
|
|
|
|
schema: T,
|
|
|
|
): OpenAPIV3.SchemaObject => {
|
|
|
|
return omitKeys(schema, '$id', 'components');
|
|
|
|
};
|
|
|
|
|
2022-04-25 14:17:59 +02:00
|
|
|
export const createOpenApiSchema = (
|
|
|
|
serverUrl?: string,
|
|
|
|
): Omit<OpenAPIV3.Document, 'paths'> => {
|
|
|
|
return {
|
|
|
|
openapi: '3.0.3',
|
|
|
|
servers: serverUrl ? [{ url: serverUrl }] : [],
|
|
|
|
info: {
|
|
|
|
title: 'Unleash API',
|
2022-06-08 08:01:14 +02:00
|
|
|
version: process.env.npm_package_version!,
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
2022-06-08 08:01:14 +02:00
|
|
|
security: [{ apiKey: [] }],
|
2022-04-25 14:17:59 +02:00
|
|
|
components: {
|
|
|
|
securitySchemes: {
|
|
|
|
apiKey: {
|
|
|
|
type: 'apiKey',
|
|
|
|
in: 'header',
|
|
|
|
name: 'Authorization',
|
|
|
|
},
|
|
|
|
},
|
2022-06-10 10:04:56 +02:00
|
|
|
schemas: mapValues(schemas, removeJsonSchemaProps),
|
2022-04-25 14:17:59 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|