Skip to content

Commit

Permalink
fix: swagger
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 committed Oct 6, 2024
1 parent 5c42201 commit 631c458
Show file tree
Hide file tree
Showing 22 changed files with 929 additions and 742 deletions.
6 changes: 4 additions & 2 deletions .deps/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
| [`add-stream@1.0.0`](https://github.com/wilsonjackson/add-stream) | MIT | clearlydefined |
| [`agent-base@6.0.2`](git://github.com/TooTallNate/node-agent-base.git) | MIT | clearlydefined |
| [`agentkeepalive@4.5.0`](git://github.com/node-modules/agentkeepalive.git) | MIT | clearlydefined |
| [`ajv-formats@2.1.1`](git+https://github.com/ajv-validator/ajv-formats.git) | MIT | clearlydefined |
| [`ajv-keywords@3.5.2`](git+https://github.com/epoberezkin/ajv-keywords.git) | MIT | clearlydefined |
| [`ajv-keywords@5.1.0`](git+https://github.com/epoberezkin/ajv-keywords.git) | MIT | clearlydefined |
| [`ansi-colors@4.1.3`](https://github.com/doowb/ansi-colors) | MIT | clearlydefined |
Expand All @@ -224,7 +225,7 @@
| [`are-we-there-yet@3.0.1`](https://github.com/npm/are-we-there-yet.git) | ISC | clearlydefined |
| [`are-we-there-yet@4.0.2`](https://github.com/npm/are-we-there-yet.git) | ISC | clearlydefined |
| `argparse@1.0.10` | MIT | #2174 |
| [`aria-query@5.3.0`](git+https://github.com/A11yance/aria-query.git) | Apache-2.0 | clearlydefined |
| [`aria-query@5.3.0`](git+https://github.com/A11yance/aria-query.git) | Apache-2.0 | #16427 |
| [`array-buffer-byte-length@1.0.0`](git+https://github.com/inspect-js/array-buffer-byte-length.git) | MIT | #7548 |
| `array-differ@3.0.0` | MIT | clearlydefined |
| [`array-ify@1.0.0`](https://github.com/stevemao/array-ify) | MIT | clearlydefined |
Expand Down Expand Up @@ -778,6 +779,7 @@
| `p-finally@1.0.0` | MIT | clearlydefined |
| `p-limit@1.3.0` | MIT | clearlydefined |
| `p-limit@2.3.0` | MIT | clearlydefined |
| `p-limit@3.1.0` | MIT | clearlydefined |
| `p-locate@2.0.0` | MIT | clearlydefined |
| `p-locate@3.0.0` | MIT | clearlydefined |
| `p-locate@4.1.0` | MIT | clearlydefined |
Expand Down Expand Up @@ -928,7 +930,6 @@
| [`semver@5.7.2`](https://github.com/npm/node-semver.git) | ISC | #5900 |
| [`semver@6.3.1`](https://github.com/npm/node-semver.git) | ISC | clearlydefined |
| [`semver@7.3.8`](https://github.com/npm/node-semver.git) | ISC | clearlydefined |
| [`semver@7.6.3`](git+https://github.com/npm/node-semver.git) | ISC | #14659 |
| [`serialize-javascript@6.0.1`](git+https://github.com/yahoo/serialize-javascript.git) | BSD-3-Clause | #12680 |
| [`set-blocking@2.0.0`](git+https://github.com/yargs/set-blocking.git) | ISC | #5899 |
| [`set-function-length@1.1.1`](git+https://github.com/ljharb/set-function-length.git) | MIT | #11090 |
Expand Down Expand Up @@ -1105,3 +1106,4 @@
| [`yargs-parser@21.1.1`](https://github.com/yargs/yargs-parser.git) | ISC | clearlydefined |
| [`yargs@16.2.0`](https://github.com/yargs/yargs.git) | MIT | clearlydefined |
| [`yargs@17.7.2`](https://github.com/yargs/yargs.git) | MIT | #8222 |
| `yocto-queue@0.1.0` | MIT | clearlydefined |
18 changes: 18 additions & 0 deletions .deps/problems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dependency analysis

## UNRESOLVED Production dependencies

1. `@fastify/ajv-compiler@4.0.1`
2. `@fastify/cookie@10.0.1`
3. `@fastify/cors@10.0.1`
4. `@fastify/fast-json-stringify-compiler@5.0.1`
5. `@fastify/oauth2@8.0.1`
6. `@fastify/rate-limit@10.1.1`
7. `@fastify/reply-from@11.0.1`
8. `@fastify/static@8.0.1`
9. `@fastify/swagger@9.1.0`
10. `fast-uri@2.4.0`
11. `fastify@5.0.0`
12. `glob@11.0.0`
13. `jackspeak@4.0.2`
14. `light-my-request@6.0.0`
73 changes: 39 additions & 34 deletions .deps/prod.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions packages/common/src/dto/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ export interface IDevWorkspaceList {
}

export interface IDevWorkspaceResources {
devfileContent: string | undefined;
editorPath: string | undefined;
pluginRegistryUrl: string | undefined;
editorId: string | undefined;
editorContent: string | undefined;
devfileContent?: string | undefined;
editorPath?: string | undefined;
pluginRegistryUrl?: string | undefined;
editorId?: string | undefined;
editorContent?: string | undefined;
}

export interface IGettingStartedSample {
Expand Down
18 changes: 9 additions & 9 deletions packages/dashboard-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
"dependencies": {
"@devfile/api": "2.3.0-1721400636",
"@eclipse-che/che-devworkspace-generator": "7.90.0-next-4510df7",
"@fastify/cors": "^9.0.1",
"@fastify/cors": "^10.0.0",
"@fastify/error": "^3.4.1",
"@fastify/http-proxy": "^9.5.0",
"@fastify/oauth2": "^7.8.1",
"@fastify/rate-limit": "^9.1.0",
"@fastify/static": "^6.10.2",
"@fastify/swagger": "^8.14.0",
"@fastify/swagger-ui": "3.0.0",
"@fastify/websocket": "^10.0.1",
"@fastify/http-proxy": "^10.0.0",
"@fastify/oauth2": "^8.0.0",
"@fastify/rate-limit": "^10.0.0",
"@fastify/static": "^8.0.0",
"@fastify/swagger": "^9.1.0",
"@fastify/swagger-ui": "^5.0.1",
"@fastify/websocket": "^11.0.0",
"@kubernetes/client-node": "^0.21.0",
"args": "^5.0.3",
"axios": "^1.7.0",
"fastify": "^4.27.0",
"fastify": "^5.0.0",
"fs-extra": "^11.1.1",
"https": "^1.0.0",
"js-yaml": "^4.1.0",
Expand Down
82 changes: 79 additions & 3 deletions packages/dashboard-backend/src/constants/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,83 @@ export const devWorkspaceResourcesExample = {

return dump(devfile, { indent: 2 });
},
editorId: 'che-incubator/che-code/insiders',
pluginRegistryUrl: 'http://plugin-registry.eclipse-che.svc:8080/v3',
projects: [],
get editorContent() {
const devfile = {
schemaVersion: '2.2.2',
metadata: {
description:
'Microsoft Visual Studio Code - Open Source IDE for Eclipse Che - Insiders build',
displayName: 'VS Code - Open Source',
name: 'che-code',
tags: ['Tech-Preview'],
},
commands: [
{
apply: {
component: 'che-code-injector',
},
id: 'init-container-command',
},
{
exec: {
commandLine:
'nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt 2>&1 &',
component: 'che-code-runtime-description',
},
id: 'init-che-code-command',
},
],
components: [
{
container: {
command: ['/entrypoint-init-container.sh'],
image: 'quay.io/che-incubator/che-code:insiders',
},
name: 'che-code-injector',
},
{
attributes: {
'app.kubernetes.io/component': 'che-code-runtime',
'app.kubernetes.io/part-of': 'che-code.eclipse.org',
'controller.devfile.io/container-contribution': true,
},
container: {
endpoints: [
{
attributes: {
cookiesAuthEnabled: true,
discoverable: false,
type: 'main',
urlRewriteSupported: true,
},
exposure: 'public',
name: 'che-code',
protocol: 'https',
secure: true,
targetPort: 3100,
},
],
image: 'quay.io/devfile/universal-developer-image:latest',
volumeMounts: [
{
name: 'checode',
path: '/checode',
},
],
},
name: 'che-code-runtime-description',
},
{
name: 'checode',
volume: {},
},
],
events: {
postStart: ['init-che-code-command'],
preStart: ['init-container-command'],
},
};

return dump(devfile, { indent: 2 });
},
};
159 changes: 75 additions & 84 deletions packages/dashboard-backend/src/constants/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,78 +27,6 @@ export const authenticationHeaderSchema: JSONSchema7 = {
},
};

export const namespacedKubeConfigSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
devworkspaceId: {
type: 'string',
},
},
required: ['namespace', 'devworkspaceId'],
};

export const namespacedWorkspaceSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
workspaceName: {
type: 'string',
},
},
required: ['namespace', 'workspaceName'],
};

export const namespacedTemplateSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
templateName: {
type: 'string',
},
},
required: ['namespace', 'templateName'],
};

export const namespacedWorkspacePreferencesAuthorizationSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
provider: {
type: 'string',
},
},
required: ['namespace', 'provider'],
};

export const namespacedWorkspacePreferencesTrustedSourceSchema: JSONSchema7 = {
type: 'object',
properties: {
source: {
type: 'string',
},
},
required: ['source'],
};

export const namespacedSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
},
required: ['namespace'],
};

export const dwTemplatePatchSchema: JSONSchema7 = {
type: 'array',
items: {
Expand All @@ -120,7 +48,7 @@ export const dwTemplatePatchSchema: JSONSchema7 = {
],
};

export const devworkspacePatchSchema: JSONSchema7 = {
export const devWorkspacePatchSchema: JSONSchema7 = {
type: 'array',
items: {
type: 'object',
Expand Down Expand Up @@ -168,17 +96,6 @@ export const gitConfigSchema: JSONSchema7 = {
required: ['gitconfig'],
};

export const devfileVersionSchema: JSONSchema7 = {
type: 'object',
properties: {
version: {
type: 'string',
pattern: '^[1-2]\\.[0-2]\\.[0-2](?:-alpha)?$',
},
},
required: ['version'],
};

export const dataResolverSchema: JSONSchema7 = {
type: 'object',
properties: {
Expand Down Expand Up @@ -346,3 +263,77 @@ export const sshKeyParamsSchema: JSONSchema7 = {
},
required: ['namespace', 'name'],
};

// namespaced schemas

export const namespacedSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
},
required: ['namespace'],
};

export const namespacedKubeConfigSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
devworkspaceId: {
type: 'string',
},
},
required: ['namespace', 'devworkspaceId'],
};

export const namespacedWorkspaceSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
workspaceName: {
type: 'string',
},
},
required: ['namespace', 'workspaceName'],
};

export const namespacedTemplateSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
templateName: {
type: 'string',
},
},
required: ['namespace', 'templateName'],
};

export const namespacedWorkspacePreferencesAuthorizationSchema: JSONSchema7 = {
type: 'object',
properties: {
namespace: {
type: 'string',
},
provider: {
type: 'string',
},
},
required: ['namespace', 'provider'],
};

export const namespacedWorkspacePreferencesTrustedSourceSchema: JSONSchema7 = {
type: 'object',
properties: {
source: {
type: 'string',
},
},
required: ['source'],
};
Loading

0 comments on commit 631c458

Please sign in to comment.