Skip to content

Commit 628adbc

Browse files
Merge pull request #477 from zenml-io/dev
Dev
2 parents da5f9fa + d515dd2 commit 628adbc

File tree

249 files changed

+13226
-1502
lines changed

Some content is hidden

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

249 files changed

+13226
-1502
lines changed

generateOpenApiTypes.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const fs = require('fs');
2+
const openapiTS = require('openapi-typescript');
3+
4+
// Logging function with emojis
5+
function log(message, emoji) {
6+
console.log(`${emoji} ${message}`);
7+
}
8+
9+
(async () => {
10+
log('Script started.', '✨');
11+
12+
const output = await openapiTS('https://appserver.zenml.io/openapi.json', {
13+
exportType: true,
14+
transform: (schema) => {
15+
customTransformer(schema);
16+
},
17+
});
18+
19+
log('Writing output to file...', '📝');
20+
fs.writeFileSync('schema.d.ts', output);
21+
22+
log('Script completed successfully.', '✅');
23+
})();
24+
25+
/**
26+
*
27+
* @param {import("openapi-typescript").SchemaObject} schema
28+
* @returns {import("openapi-typescript").SchemaObject}
29+
*/
30+
function customTransformer(schema) {
31+
if (schema.type === 'object' && !schema.properties) {
32+
schema.additionalProperties = true;
33+
}
34+
return schema;
35+
}

global.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,26 @@ interface Workspaces {
143143
name: string;
144144
description: string;
145145
}
146-
interface TPipeline {
147-
id: TId;
148-
name: string;
149-
created: Date;
150-
creationDate: Date;
151-
workspaceName: string;
152-
components: any;
153-
owner: string;
154-
pipelineConfig: any;
155-
userId: TId;
156-
creationDate: Date;
157-
isShared: boolean;
158-
userName: string;
159-
user: any;
160-
runs: Array;
161-
status: Array;
162-
configuration: object;
163-
spec?: any;
164-
version: string;
165-
}
146+
// interface TPipeline {
147+
// id: TId;
148+
// name: string;
149+
// created: Date;
150+
// creationDate: Date;
151+
// workspaceName: string;
152+
// components: any;
153+
// owner: string;
154+
// pipelineConfig: any;
155+
// userId: TId;
156+
// creationDate: Date;
157+
// isShared: boolean;
158+
// userName: string;
159+
// user: any;
160+
// runs: Array;
161+
// status: Array;
162+
// configuration: object;
163+
// spec?: any;
164+
// version: string;
165+
// }
166166
interface TStack {
167167
id: TId;
168168
name: string;

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web",
3-
"version": "0.10.0",
3+
"version": "0.10.1",
44
"private": true,
55
"dependencies": {
66
"@emotion/react": "^11.10.5",
@@ -64,6 +64,7 @@
6464
"build": "react-scripts --openssl-legacy-provider build",
6565
"test": "react-scripts --openssl-legacy-provider test --maxWorkers=4",
6666
"eject": "react-scripts eject",
67+
"generate-types": "node generateOpenAPITypes.js",
6768
"lint": "eslint './src/**/*.ts*'",
6869
"fix-lint": "eslint './src/**/*.ts*' --fix",
6970
"tslint": "tsc",
@@ -95,6 +96,7 @@
9596
"eslint-plugin-prettier": "^3.1.4",
9697
"eslint-plugin-react": "^7.20.5",
9798
"husky": "^8.0.0",
99+
"openapi-typescript": "^6.5.3",
98100
"prettier": "^2.0.5",
99101
"sass": "^1.66.1"
100102
},

0 commit comments

Comments
 (0)