Skip to content

Commit 351adf9

Browse files
Serge Pavlyukstepanenkoxx
andauthored
Entries schemas (#2629)
Co-authored-by: Vladimir Stepanenko πŸ΄β€β˜ οΈ <[email protected]>
1 parent bde4e9d commit 351adf9

File tree

52 files changed

+1302
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1302
-132
lines changed

β€Žapi/server/app-env.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export {
44
isDatalensMode,
55
isFullMode,
66
isApiMode,
7+
isPublicApiMode,
78
} from '../../src/server/app-env';

β€Žapi/server/components.tsβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ export {
1919
} from '../../src/server/components/charts-engine';
2020

2121
export {renderHTML} from '../../src/server/components/charts-engine/components/markdown';
22+
23+
export {initPublicApiSwagger} from '../../src/server/components/public-api';
24+
25+
export {PUBLIC_API_PROXY_MAP, PUBLIC_API_ROUTE} from '../../src/server/components/public-api';
26+
export type {
27+
PublicApiRpcMap,
28+
PublicApiConfig,
29+
PublicApiSecuritySchemes,
30+
} from '../../src/server/components/public-api/types';

β€Žapi/server/constants.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export {SERVICE_NAME_DATALENS} from '../../src/server/constants';
22
export {IPV6_AXIOS_OPTIONS} from '../../src/server/constants/axios';
3+
export {PUBLIC_API_ORG_ID_HEADER} from '../../src/server/constants/public-api';

β€Žapi/server/controllers.tsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export {ping} from '../../src/server/controllers/ping';
22
export {chartsController} from '../../src/server/components/charts-engine/controllers/charts';
3+
export {createPublicApiController} from '../../src/server/controllers';

β€Žpackage-lock.jsonβ€Ž

Lines changed: 89 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žpackage.jsonβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"author": "DataLens Team <https://github.com/datalens-tech>",
5555
"license": "Apache-2.0",
5656
"dependencies": {
57+
"@asteasolutions/zod-to-openapi": "^7.3.4",
5758
"@braintree/sanitize-url": "^6.0.0",
5859
"@datalens-tech/ui-sandbox-modules": "^0.36.0",
5960
"@datalens-tech/xlsx": "^0.20.1",
@@ -118,7 +119,9 @@
118119
"request-ip": "^3.3.0",
119120
"request-promise-native": "^1.0.9",
120121
"set-cookie-parser": "^2.7.1",
121-
"workerpool": "^9.1.1"
122+
"swagger-ui-express": "^5.0.1",
123+
"workerpool": "^9.1.1",
124+
"zod": "^3.25.64"
122125
},
123126
"devDependencies": {
124127
"@floating-ui/react": "^0.27.13",
@@ -181,6 +184,7 @@
181184
"@types/request-ip": "^0.0.41",
182185
"@types/request-promise-native": "^1.0.21",
183186
"@types/set-cookie-parser": "^2.4.10",
187+
"@types/swagger-ui-express": "^4.1.8",
184188
"@types/uuid": "^9.0.8",
185189
"@types/webpack-env": "^1.16.0",
186190
"bem-cn-lite": "^4.0.0",

β€Žsrc/server/app-env.tsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ export const isFullMode = mode === AppMode.Full;
1010
export const isDatalensMode = mode === AppMode.Datalens;
1111
export const isChartsMode = mode === AppMode.Charts;
1212
export const isApiMode = mode === AppMode.Api;
13+
export const isPublicApiMode = mode === AppMode.PublicApi;
14+
1315
export const isOpensourceInstallation = appInstallation === AppInstallation.Opensource;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const CONTENT_TYPE_JSON = 'application/json';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type {SecuritySchemeObject} from './types';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copied from @asteasolutions/zod-to-openapi
2+
export type Method = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'head' | 'options' | 'trace';
3+
4+
export type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
5+
6+
export type SecuritySchemeObject = {
7+
type: SecuritySchemeType;
8+
description?: string;
9+
name?: string;
10+
in?: string;
11+
scheme?: string;
12+
bearerFormat?: string;
13+
openIdConnectUrl?: string;
14+
};

0 commit comments

Comments
Β (0)