Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
epip-generate
Advanced tools
epip-generate is a powerful package designed to automate the creation of backend services from API definitions using swagger.json. It generates all DTOs, services, and even backend validations automatically, streamlining your development process.
epip-generate is a powerful package designed to automate the creation of backend services from API definitions using swagger.json. It generates all DTOs, services, and even backend validations automatically, streamlining your development process.
Install the package as a development dependency using npm:
npm i epip-generate -D
There are two ways to implement epip-generate in your project:
{
"scripts": {
"make:api": "epip-generate vue -o ./src/repository -p to -h https://api.test.hemscap.com/v1/api/swagger.json -in @core/interceptor -e VITE_APP_URL -s 2 -ti 300000 && npm run format"
},
"dependencies": {
// your dependencies here
},
"devDependencies": {
"epip-generate": "latest"
// your dev dependencies here
}
}
import { defineConfig } from 'vite';
import { EpipGenerateVitePlugin } from 'epip-generate';
export default defineConfig({
plugins: [
EpipGenerateVitePlugin({
type: 'vue',
destinationPath: process.env.VITE_EPIP_DESC_PATH as string,
plugins: ['to'],
swaggerPath: process.env.VITE_EPIP_SWAGGER as string,
interceptorPath: process.env.VITE_EPIP_INTERCEPTOR_PATH as string,
baseUrlEnvironmentKey: process.env.VITE_EPIP_ENV_KEY as string,
numberOfBackPathModels: 2,
axiosTimeoutMillisecond: 300000
})
]
});
The epip-generate package offers several configuration options:
vue: Generates services using axios.
angular: Intended to generate services using rxjs (currently not implemented).
react: Intended to generate services using hooks (currently not implemented)\
destinationPath: The path where the generated files will be stored.
plugins: Array<"to" | "class-dto">
swaggerPath: The path to your swagger.json file.
interceptorPath: The path to a file that exports the following three methods:
export const onRequest = async function (config: any) {
// your code...
return config;
};
export const onResponse = function (response: any) {
// your code...
return response.data;
};
export const onResponseError = function (response: AxiosError) {
// your code...
throw response;
};
baseUrlEnvironmentKey: The environment variable key that contains the base URL for your APIs.
numberOfBackPathModels: The number of directories to traverse back for path resolution in the model.ts file.
axiosTimeoutMillisecond: The timeout value for axios requests, in milliseconds.
FAQs
epip-generate is a powerful package designed to automate the creation of backend services from API definitions using swagger.json. It generates all DTOs, services, and even backend validations automatically, streamlining your development process.
The npm package epip-generate receives a total of 95 weekly downloads. As such, epip-generate popularity was classified as not popular.
We found that epip-generate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.