-
Notifications
You must be signed in to change notification settings - Fork 62
Entries schemas #2629
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
Merged
Merged
Entries schemas #2629
Changes from 47 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
548e2ed
Add entry zod schemas
flops ca6789f
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops cf9a3b7
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops 7b96f7b
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops 6e16468
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops 0efbbd7
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops f6b1eb1
Added public-api export
flops 9f50ea3
Swagger
flops 0b20b13
Add wizard api hanlers
flops d6a4680
Wizard Hierarchy fix
flops c7eb299
Wizard update and create
flops 08a08a1
Fix types and comment
flops 5356131
Added actions
flops fafce39
Dash descriptions
flops 33915fb
Merge branch 'main' of github.com:datalens-tech/datalens-ui into CHAR…
flops 9e87f79
Public api features (#2800)
stepanenkoxx d6830ef
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx 8fcbfd2
Split api and public api (#2839)
stepanenkoxx b88c016
Add packages
stepanenkoxx 2f1bd24
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx 2242111
Fixes
stepanenkoxx 23e96e0
Fixes
stepanenkoxx d98cb39
Fixes
stepanenkoxx f99ffe7
Fixes
stepanenkoxx eafd00f
Fixes
stepanenkoxx 2c62320
Fixes
stepanenkoxx f05fe9a
Fixes
stepanenkoxx c1926b0
Fixes
stepanenkoxx ef227f1
Fixes
stepanenkoxx fc03943
Fixes
stepanenkoxx b71dffb
Fixes
stepanenkoxx d6bc6ce
Fixes
stepanenkoxx 90f164b
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx ee32104
Fixes
stepanenkoxx 4c1a1b4
Fixes
stepanenkoxx c409620
Fixes
stepanenkoxx b2c46d8
Fixes
stepanenkoxx 1f6a310
Fixes
stepanenkoxx d84109f
Fixes
stepanenkoxx d4a8348
Review fixes
stepanenkoxx dfacf28
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx 20c64a6
Remove not ready schemas
stepanenkoxx 4dee5d0
Remove not ready schemas
stepanenkoxx 5c2d0ce
Fix ts
stepanenkoxx 74cc9c0
Fixes
stepanenkoxx eef7f52
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx 2a29f46
Fix dataset schemas
stepanenkoxx 2afa7fe
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx ecf4bf0
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx eea7c21
Review fixes
stepanenkoxx e061d0d
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx e2ea3e1
Review fixes
stepanenkoxx 5aa1996
Merge branch 'main' into CHARTS-11469-schema
stepanenkoxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ export { | |
isDatalensMode, | ||
isFullMode, | ||
isApiMode, | ||
isPublicApiMode, | ||
} from '../../src/server/app-env'; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export {SERVICE_NAME_DATALENS} from '../../src/server/constants'; | ||
export {IPV6_AXIOS_OPTIONS} from '../../src/server/constants/axios'; | ||
export {PUBLIC_API_ORG_ID_HEADER} from '../../src/server/constants/public-api'; |
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,2 +1,3 @@ | ||
export {ping} from '../../src/server/controllers/ping'; | ||
export {chartsController} from '../../src/server/components/charts-engine/controllers/charts'; | ||
export {createPublicApiController} from '../../src/server/controllers'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
export const CONTENT_TYPE_JSON = 'application/json'; |
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 @@ | ||
export type {SecuritySchemeObject} from './types'; |
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,14 @@ | ||
// Copied from @asteasolutions/zod-to-openapi | ||
export type Method = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace'; | ||
|
||
export type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect'; | ||
|
||
export type SecuritySchemeObject = { | ||
type: SecuritySchemeType; | ||
description?: string; | ||
name?: string; | ||
in?: string; | ||
scheme?: string; | ||
bearerFormat?: string; | ||
openIdConnectUrl?: string; | ||
}; |
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,87 @@ | ||
import {OpenAPIRegistry} from '@asteasolutions/zod-to-openapi'; | ||
|
||
import type {PublicApiRpcMap} from './types'; | ||
|
||
export const publicApiOpenApiRegistry = new OpenAPIRegistry(); | ||
|
||
export const PUBLIC_API_HTTP_METHOD = 'POST'; | ||
export const PUBLIC_API_URL = '/rpc/:version/:action'; | ||
export const PUBLIC_API_ROUTE = `${PUBLIC_API_HTTP_METHOD} ${PUBLIC_API_URL}`; | ||
|
||
enum ApiTag { | ||
Connection = 'Connection', | ||
Dataset = 'Dataset', | ||
Wizard = 'Wizard', | ||
Editor = 'Editor', | ||
Dashboard = 'Dashboard', | ||
} | ||
|
||
export const PUBLIC_API_PROXY_MAP = { | ||
v0: { | ||
// Connection | ||
deleteConnection: { | ||
resolve: (api) => api.bi.deleteConnection, | ||
openApi: { | ||
summary: 'Delete connection', | ||
tags: [ApiTag.Connection], | ||
}, | ||
}, | ||
|
||
// Dataset | ||
getDataset: { | ||
resolve: (api) => api.bi.getDatasetByVersion, | ||
openApi: { | ||
summary: 'Get dataset', | ||
tags: [ApiTag.Dataset], | ||
}, | ||
}, | ||
updateDataset: { | ||
resolve: (api) => api.bi.updateDataset, | ||
openApi: { | ||
summary: 'Update dataset', | ||
tags: [ApiTag.Dataset], | ||
}, | ||
}, | ||
createDataset: { | ||
resolve: (api) => api.bi.createDataset, | ||
openApi: { | ||
summary: 'Create dataset', | ||
tags: [ApiTag.Dataset], | ||
}, | ||
}, | ||
deleteDataset: { | ||
resolve: (api) => api.bi.deleteDataset, | ||
openApi: { | ||
summary: 'Delete dataset', | ||
tags: [ApiTag.Dataset], | ||
}, | ||
}, | ||
|
||
// Wizard | ||
deleteWizardChart: { | ||
resolve: (api) => api.mix.__deleteWizardChart__, | ||
openApi: { | ||
summary: 'Delete wizard chart', | ||
tags: [ApiTag.Wizard], | ||
}, | ||
}, | ||
|
||
// Editor | ||
deleteEditorChart: { | ||
resolve: (api) => api.mix.__deleteEditorChart__, | ||
openApi: { | ||
summary: 'Delete editor chart', | ||
tags: [ApiTag.Editor], | ||
}, | ||
}, | ||
|
||
// Dashboard | ||
deleteDashboard: { | ||
resolve: (api) => api.mix.__deleteDashboard__, | ||
openApi: { | ||
summary: 'Delete dashboard', | ||
tags: [ApiTag.Dashboard], | ||
}, | ||
}, | ||
}, | ||
} satisfies PublicApiRpcMap; |
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 @@ | ||
export { | ||
PUBLIC_API_PROXY_MAP, | ||
PUBLIC_API_HTTP_METHOD, | ||
PUBLIC_API_ROUTE, | ||
PUBLIC_API_URL, | ||
} from './constants'; | ||
export {initPublicApiSwagger, registerActionToOpenApi} from './utils'; |
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,29 @@ | ||
import type {Request, Response} from '@gravity-ui/expresskit'; | ||
import type {ApiWithRoot, GatewayActionUnaryResponse, SchemasByScope} from '@gravity-ui/gateway'; | ||
|
||
import type {DatalensGatewaySchemas} from '../../types/gateway'; | ||
import type {SecuritySchemeObject} from '../api-docs'; | ||
|
||
export type PublicApiRpcMap<TSchema extends SchemasByScope = DatalensGatewaySchemas> = Record< | ||
string, | ||
Record< | ||
string, | ||
{ | ||
resolve: ( | ||
api: ApiWithRoot<TSchema, Request['ctx'], Request, Response>, | ||
) => (params: any) => Promise<GatewayActionUnaryResponse<unknown>>; | ||
openApi: { | ||
summary: string; | ||
tags?: string[]; | ||
}; | ||
} | ||
> | ||
>; | ||
|
||
export type PublicApiSecuritySchemes = Record<string, SecuritySchemeObject>; | ||
|
||
export type PublicApiConfig<TSchema extends SchemasByScope = DatalensGatewaySchemas> = { | ||
proxyMap: PublicApiRpcMap<TSchema>; | ||
securitySchemes: PublicApiSecuritySchemes; | ||
securityTypes: string[]; | ||
}; |
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,2 @@ | ||
export {initPublicApiSwagger} from './init-public-api-swagger'; | ||
export {registerActionToOpenApi} from './register-action-to-open-api'; |
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.
Uh oh!
There was an error while loading. Please reload this page.