-
Notifications
You must be signed in to change notification settings - Fork 383
Decouple ui/* from api/* via openapi types #4725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KrumTy
wants to merge
29
commits into
fe/feature/RI-7039-replace-eui
Choose a base branch
from
feature/resolve-ts-issues
base: fe/feature/RI-7039-replace-eui
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
bf14313
add openapi-generator-cli
KrumTy c7e81a8
run generate-client
KrumTy c14b283
update swagger fields
KrumTy 4e88dce
use swagger generated dtos/models for some ui components
KrumTy 08f82aa
update swagger docs
KrumTy 6f14c82
update api documentation/swagger types
KrumTy f5aae22
decouple api src/* from ui
KrumTy bc2b1bc
decouple a lot of apiSrc/ references from ui
KrumTy b44b204
decouple more apiSrc/ from ui
KrumTy ca69d01
update api types
KrumTy 0f214d6
update api types
KrumTy d7b481b
update api types
KrumTy 6b01e88
use api types
KrumTy 69d9b76
use api types
KrumTy 9109723
update api types
KrumTy 8cda749
fix types
KrumTy a138eca
update types
KrumTy 6d40ba7
update types
KrumTy 82c56a5
fix more type imports
KrumTy 6645547
use more api types
KrumTy 4ca94a9
decouple final apiSrc ui components
KrumTy 12079de
remove apiSrc alias configs
KrumTy 87a4e31
Merge remote-tracking branch 'origin/fe/feature/RI-7039-replace-eui' …
KrumTy 2ed73d6
use single file for api-client
KrumTy 5f4a9ae
update eslint configs
KrumTy 3fbc9d7
revert service change
KrumTy 7e45f36
fix ui issue
KrumTy 07b800a
ignore api-client for jest coverage
KrumTy 5c05cfb
Merge remote-tracking branch 'origin/fe/feature/RI-7039-replace-eui' …
KrumTy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "7.14.0" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
redisinsight/api/src/common/decorators/redis-string-schema.decorator.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export const REDIS_STRING_SCHEMA = { | ||
type: String, | ||
oneOf: [ | ||
{ type: 'string' }, | ||
{ | ||
type: 'object', | ||
properties: { | ||
type: { type: 'string', enum: ['Buffer'], example: 'Buffer' }, | ||
data: { | ||
type: 'array', | ||
items: { type: 'number' }, | ||
example: [61, 101, 49], | ||
}, | ||
}, | ||
required: ['type', 'data'], | ||
}, | ||
], | ||
}; | ||
|
||
export const ApiRedisString = ( | ||
description: string = undefined, | ||
isArray = false, | ||
required = true, | ||
) => | ||
ApiProperty({ | ||
description, | ||
isArray, | ||
required, | ||
...REDIS_STRING_SCHEMA, | ||
}); |
13 changes: 6 additions & 7 deletions
13
redisinsight/api/src/modules/browser/hash/dto/delete.fields-from-hash.dto.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
redisinsight/api/src/modules/browser/hash/dto/hash-field.dto.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
redisinsight/api/src/modules/browser/keys/dto/delete.keys.dto.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
redisinsight/api/src/modules/browser/keys/dto/get.keys-info.response.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
redisinsight/api/src/modules/browser/keys/dto/rename.key.dto.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
redisinsight/api/src/modules/browser/keys/dto/rename.key.response.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
redisinsight/api/src/modules/browser/list/dto/delete.list-elements.response.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { RedisStringType } from 'src/common/decorators'; | ||
import { ApiRedisString, RedisStringType } from 'src/common/decorators'; | ||
import { RedisString } from 'src/common/constants'; | ||
|
||
export class DeleteListElementsResponse { | ||
@ApiProperty({ | ||
type: String, | ||
isArray: true, | ||
description: 'Removed elements from list', | ||
}) | ||
@ApiRedisString('Removed elements from list', true) | ||
@RedisStringType({ each: true }) | ||
elements: RedisString[]; | ||
} |
8 changes: 2 additions & 6 deletions
8
redisinsight/api/src/modules/browser/list/dto/get.list-element.response.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import { KeyResponse } from 'src/modules/browser/keys/dto'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { RedisStringType } from 'src/common/decorators'; | ||
import { ApiRedisString, RedisStringType } from 'src/common/decorators'; | ||
import { RedisString } from 'src/common/constants'; | ||
|
||
export class GetListElementResponse extends KeyResponse { | ||
@ApiProperty({ | ||
type: () => String, | ||
description: 'Element value', | ||
}) | ||
@ApiRedisString('Element value') | ||
@RedisStringType() | ||
value: RedisString; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so