Skip to content

Commit

Permalink
Merge pull request #478 from zenml-io/UAT
Browse files Browse the repository at this point in the history
Uat
  • Loading branch information
Cahllagerfeld authored Aug 31, 2023
2 parents da5f9fa + 628adbc commit bb42c49
Show file tree
Hide file tree
Showing 249 changed files with 13,226 additions and 1,502 deletions.
35 changes: 35 additions & 0 deletions generateOpenApiTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const fs = require('fs');
const openapiTS = require('openapi-typescript');

// Logging function with emojis
function log(message, emoji) {
console.log(`${emoji} ${message}`);
}

(async () => {
log('Script started.', '✨');

const output = await openapiTS('https://appserver.zenml.io/openapi.json', {
exportType: true,
transform: (schema) => {
customTransformer(schema);
},
});

log('Writing output to file...', '📝');
fs.writeFileSync('schema.d.ts', output);

log('Script completed successfully.', '✅');
})();

/**
*
* @param {import("openapi-typescript").SchemaObject} schema
* @returns {import("openapi-typescript").SchemaObject}
*/
function customTransformer(schema) {
if (schema.type === 'object' && !schema.properties) {
schema.additionalProperties = true;
}
return schema;
}
40 changes: 20 additions & 20 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,26 +143,26 @@ interface Workspaces {
name: string;
description: string;
}
interface TPipeline {
id: TId;
name: string;
created: Date;
creationDate: Date;
workspaceName: string;
components: any;
owner: string;
pipelineConfig: any;
userId: TId;
creationDate: Date;
isShared: boolean;
userName: string;
user: any;
runs: Array;
status: Array;
configuration: object;
spec?: any;
version: string;
}
// interface TPipeline {
// id: TId;
// name: string;
// created: Date;
// creationDate: Date;
// workspaceName: string;
// components: any;
// owner: string;
// pipelineConfig: any;
// userId: TId;
// creationDate: Date;
// isShared: boolean;
// userName: string;
// user: any;
// runs: Array;
// status: Array;
// configuration: object;
// spec?: any;
// version: string;
// }
interface TStack {
id: TId;
name: string;
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "0.10.0",
"version": "0.10.1",
"private": true,
"dependencies": {
"@emotion/react": "^11.10.5",
Expand Down Expand Up @@ -64,6 +64,7 @@
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts --openssl-legacy-provider test --maxWorkers=4",
"eject": "react-scripts eject",
"generate-types": "node generateOpenAPITypes.js",
"lint": "eslint './src/**/*.ts*'",
"fix-lint": "eslint './src/**/*.ts*' --fix",
"tslint": "tsc",
Expand Down Expand Up @@ -95,6 +96,7 @@
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.5",
"husky": "^8.0.0",
"openapi-typescript": "^6.5.3",
"prettier": "^2.0.5",
"sass": "^1.66.1"
},
Expand Down
Loading

0 comments on commit bb42c49

Please sign in to comment.