Christopher Kolstad
18c720f4e9
Task/open api state ( #1738 )
...
* task: add open api to import/export
2022-06-22 09:09:49 +02:00
olav
5bae11a3fb
fix: avoid 400s for unknown request body fields ( #1737 )
2022-06-21 10:33:03 +02:00
olav
7ee8892704
fix: add missing environments field to uiConfigSchema ( #1736 )
...
* fix: add missing environment field to uiConfigSchema
* refactor: avoid throwing when unleash-server is a dependency in dev mode
2022-06-21 09:34:07 +02:00
Christopher Kolstad
32399291e0
task: add OpenApi spec to metrics route ( #1725 )
...
* task: add OpenApi spec to metrics route
2022-06-21 09:12:40 +02:00
Christopher Kolstad
1821af8fe7
task: add openapi for tags ( #1724 )
...
* task: add openapi for tags
2022-06-21 08:23:30 +02:00
Nuno Góis
123991d28f
refactor: add OpenAPI schema to health-check controller ( #1732 )
...
* refactor: add OpenAPI schema to health-check controller
* refactor: address PR comments
* add type to health-check-schema
* fix: update snap
2022-06-20 11:22:41 +01:00
Nuno Góis
2354656632
refactor: add OpenAPI schema to api-token controller ( #1716 )
...
* refactor: add OpenAPI schema to api-token controller
* refactor: address PR comments
* fix: status codes on environment toggling
* fix tests
* refactor: address PR comments
* refactor: expiresAtSchema -> update-api-token-schema
2022-06-17 20:35:26 +01:00
Nuno Góis
525fce3e86
refactor: add OpenAPI schema to context controller ( #1711 )
...
* refactor: add OpenAPI schema to context controller
* Update src/lib/routes/admin-api/context.ts
Co-authored-by: olav <mail@olav.io>
* address PR comments, misc fixes and improvements
* refactor: address PR comments
* add createdAt to test
* fix: reverted upsert schema after discussion
Co-authored-by: olav <mail@olav.io>
2022-06-17 10:11:55 +01:00
olav
28ecb158a9
refactor: add schemas to feedback controller ( #1698 )
...
* refactor: remove previous getProjects route
* refactor: add schemas to feedback controller
2022-06-17 08:15:56 +02:00
nya1
fb711b4d4a
fix: when payload type is 'json' validate value on toggle variable validation ( #1704 )
...
* fix: when payload type is 'json' validate value on toggle variable validation
* test: add missing feature toggle creation with variant type json
Ref https://github.com/Unleash/unleash/pull/1704#discussion_r896476042
* refractor: remove verbose comment on validateJsonString
Ref https://github.com/Unleash/unleash/pull/1704#discussion_r896482210
* test: add missing feature toggle creation with variant type string
Ref https://github.com/Unleash/unleash/pull/1704#discussion_r896476042
* refractor: move variant value joi validation
Ref https://github.com/Unleash/unleash/pull/1704#discussion_r896478563
2022-06-14 13:08:38 +02:00
Christopher Kolstad
780bb06dba
task: add open-api for tag-types ( #1700 )
...
* task: add open-api for tag-types
2022-06-14 09:06:41 +02:00
olav
47a719238d
refactor: fix duplicate operationIds ( #1701 )
2022-06-10 15:11:41 +02:00
olav
1264f8cb13
refactor: add schemas to splash controller ( #1697 )
2022-06-10 15:11:07 +02:00
olav
adface17c7
refactor: add OpenAPI schema to environments controller ( #1682 )
...
* refactor: normalize controller file names
* refactor: throw invalid responses in dev mode
* refactor: add OpenAPI schema to environments controller
* refactor: improve JSON schema prop removal code
* refactor: fix empty response specs
2022-06-10 10:04:56 +02:00
Dennis Szczepanski
7ead887147
fix: Issue #1444 - API import with drop=true deletes existing client keys ( #1668 )
...
* fix: Does not delete api_tokens on drop-Import
* feat: Cleans unused apiTokens on environment import
* refactor: Moves ALL_PROJECTS and ALL_ENVIRONMENTS to constants
* refactor: Renames migration 20220528143630 for a more precise name
* refactor: Removes unecessary console.log
* fix: Adds correct down-script for migration 20220528143630
2022-06-09 15:56:13 +01:00
olav
138300ab22
refactor: add OpenAPI schema to feature types controller ( #1684 )
...
* refactor: fix feature types id type
* refactor: fix error-hiding Controller imports
* refactor: add OpenAPI schema to feature types controller
2022-06-09 13:17:13 +02:00
olav
1ed8dd0f0d
refactor: add OpenAPI schema to constraints controller ( #1683 )
...
* refactor: add OpenAPI schema to constraints controller
* refactor: add more schema tests
2022-06-09 10:35:39 +02:00
olav
6adcf103f0
fix: clone segments when cloning a toggle ( #1678 )
...
* refactor: merge segment test files
* fix: clone segments when cloning a toggle
2022-06-08 15:41:02 +02:00
olav
04c107a26e
refactor: add OpenAPI schemas to more controllers ( #1680 )
2022-06-08 15:31:34 +02:00
olav
09a6b578bf
refactor: add OpenAPI schema to UI config controller ( #1681 )
2022-06-08 14:57:39 +02:00
Christopher Kolstad
37211491e7
feat: default to memoizing client features ( #1674 )
2022-06-08 09:43:37 +02:00
olav
13ef025fab
refactor: add soft response schema validation ( #1657 )
...
* refactor: remove most schema refs
* refactor: generalize request/response schemas
* refactor: simplify schema date formats
* refactor: add soft response schema validation
* refactor: fix emptySchema definition
* refactor: update json-schema-to-ts and use refs
2022-06-08 08:01:14 +02:00
olav
dadbc3addc
fix: add missing segment-deleted event data ( #1677 )
2022-06-07 14:06:45 +02:00
olav
ee35c7ad74
refactor: replace ts-ignore with ts-expect-error ( #1675 )
...
* refactor: replace ts-ignore with ts-expect-error
* refactor: remove unused ts-expect-errors
2022-06-07 11:49:17 +02:00
Christopher Kolstad
7895002602
feat: add OpenApi spec to feature variants ( #1659 )
...
* feat: add OpenApi spec to feature variants
2022-06-03 13:16:59 +02:00
olav
7e3f0329ab
refactor: avoid inlining segments for supported clients ( #1640 )
...
* refactor: add semver lib types
* refactor: avoid inlining segments for supported clients
* refactor: fix FeatureController tests
* refactor: use spec version instead of client version
* refactor: improve header validation errors
2022-06-02 14:07:46 +02:00
Christopher Kolstad
00c84f3c75
fix: use getCreatedBy to set created by on events stored ( #1648 )
2022-06-02 13:52:10 +02:00
olav
224b9cb229
refactor: move segment limits to env vars ( #1642 )
...
* refactor: improve env var helpers
* refactor: remove unused segments client API
* refactor: remove experimental segment flags
* refactor: move segment limits to env vars
* refactor: add segment limits to UIConfig response
* refactor: fix type name casing
2022-06-02 10:44:45 +02:00
sighphyre
0c1213ff81
feat: Add support for global segments ( #1577 )
...
feat: Add support for global segments
2022-05-30 09:10:20 +02:00
sighphyre
6273d0d924
fix: Allow project roles to be changed when the relevant user has a root role ( #1632 )
2022-05-26 16:20:36 +02:00
olav
59060ed3ea
refactor: improve OpenAPI refs ( #1620 )
...
* refactor: simplify FeatureEnvironmentSchema name
* refactor: format schema files
* fix: pass nested schemas to FromSchema
* refactor: remove ref order note
* refactor: fix overly strict required fields
* refactor: clean up mapper names and paths
* refactor: replace mappers with optional fields
2022-05-24 08:37:35 +02:00
Tymoteusz Czech
0f272680ee
fix: project environments order ( #1599 )
2022-05-23 08:52:50 +00:00
olav
b53912aef9
refactor: add regression test for long parameter values ( #1617 )
...
* refactor: add regression test for long parameter values
* refactor: format file
2022-05-20 15:44:41 +02:00
Ivar Conradi Østhus
3934509d4c
fix: failing test
2022-05-20 11:48:08 +02:00
olav
05808745a7
fix: remove parametersSchema maxLength requirement ( #1616 )
2022-05-20 11:31:34 +02:00
olav
a8d34d6268
fix: the replaceGroupId field should be optional ( #1608 )
2022-05-20 11:07:30 +02:00
andreas-unleash
1a27bffe4d
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 16:17:09 +03:00
olav
8c1d4838b8
fix: require equal environments when moving toggles ( #1595 )
...
* fix: apply query from checkProjectsCompatibility
* fix: require equal environments when moving toggles
* refactor: clean up project service tests
* refactor: add test for project compatibility check
* refactor: improve arraysHaveSameItems name
2022-05-18 11:07:01 +02:00
olav
ac90a3b1c7
fix: remove trailing slash from OpenAPI route ( #1564 )
2022-05-05 11:45:23 +02:00
olav
56615e91f0
fix: validate the type and length of parameter values ( #1559 )
...
* refactor: coerce primitive types in OpenAPI requests
* refactor: avoid broken array args to serializeDates
* refactor: avoid some spec refs to improve generated types
* refactor: remove debug logging
* refactor: fix IExpressOpenApi interface name prefix
* refactor: ensure that parameter values are strings
* refactor: test that parameter values are coerced to strings
2022-05-04 15:16:18 +02:00
Nuno Góis
61e9588bb0
fix: update open api snapshot ( #1560 )
2022-05-04 14:54:26 +02:00
Nuno Góis
7e938a21b4
feat: show archived toggles on a project level ( #1555 )
...
* feat: show archived toggles on a project level
* refactor: split behaviour in 2 separate routes and methods for clarity
* add e2e test
2022-05-04 07:45:29 +01:00
olav
c02865504e
refactor: disallow additionalProperties in response schemas ( #1543 )
2022-04-29 08:09:27 +02:00
olav
d0724afdf5
feat: add READ_API_TOKEN permission ( #1528 )
...
* refactor: extract accessibleTokens fn
* feat: add READ_API_TOKEN permission
2022-04-26 10:24:34 +02:00
olav
fdebeef929
feat: add OpenAPI validation to a few endpoints ( #1409 )
...
* feat: add OpenAPI validation to a few endpoints (2)
* refactor: use package version as the OpenAPI version
* refactor: keep the existing OpenAPI page for now
* refactor: add snapshots tests for the OpenAPI output
* refactor: validate Content-Type by default
* refactor: update vulnerable deps
* refactor: fix documentation URL to match schema
* refactor: improve external type declaration
* refactor: remove unused package resolutions
* refactor: try express-openapi fork
* Update package.json
* Update src/lib/services/openapi-service.ts
* Update src/lib/types/openapi.d.ts
* Update src/lib/types/openapi.d.ts
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2022-04-25 14:17:59 +02:00
olav
e38f7cf7c2
feat: add context value descriptions ( #1496 )
...
* feat: add context value descriptions
* refactor: upcase SQL keywords
* refactor: allow blank descriptions
2022-04-19 08:40:07 +02:00
sighphyre
c9b44b6546
Merge pull request #1476 from Unleash/feat/multi-project-tokens
...
feat: Implement multi token support for client tokens
2022-04-08 11:51:31 +02:00
Nuno Góis
794327f8e0
fix: reject duplicate segment names ( #1475 )
...
* fix: reject duplicate segment names
* refactor: remove unnecessary comment
* refactor: improve validateName logic with existsByName
* fix: removed unused NotFoundError import
2022-04-06 14:01:50 +01:00
sighphyre
e889d8e29c
feat: Implement multi token support for client tokens
...
This adds support for multi project tokens to be created. Backward compatibility is handled at 3 different layers here:
- The API is made backwards compatible though a permissive data type that accepts either a project?: string or projects?: string[] property, validation is done through JOI here, which ensures that projects and project are not set together. In the case of neither, this defaults to the previous default of ALL_PROJECTS
- The service layer method to handle adding tokens has been made tolerant to either of the above case and has been deprecated, a new method supporting only the new structure of using projects has been added
- Existing compatibility for consumers of Unleash as a library should not be affected either, the ApiUser constructor is now tolerant to the the first input and will internally map to the new cleaned structure
2022-04-06 08:11:41 +02:00
olav
1da38781d5
feat: add segment limits ( #1469 )
...
* feat: add segment limits
* refactor: move segment limits to constants
2022-04-01 10:53:52 +02:00