@nestia/migrate
Advanced tools
Comparing version 0.11.2 to 0.11.3
@@ -5,3 +5,2 @@ import { IValidation } from "typia"; | ||
import { ISwagger } from "./structures/ISwagger"; | ||
import { ISwaggerV20 } from "./structures/ISwaggerV20"; | ||
import { ISwaggerV31 } from "./structures/ISwaggerV31"; | ||
@@ -11,3 +10,3 @@ export declare class MigrateApplication { | ||
private constructor(); | ||
static create(swagger: ISwagger | ISwaggerV20 | ISwaggerV31): Promise<IValidation<MigrateApplication>>; | ||
static create(swagger: ISwagger | ISwaggerV31): Promise<IValidation<MigrateApplication>>; | ||
nest(config: MigrateApplication.IConfig): MigrateApplication.IOutput; | ||
@@ -14,0 +13,0 @@ sdk(config: MigrateApplication.IConfig): MigrateApplication.IOutput; |
import { ISwagger } from "../structures/ISwagger"; | ||
import { ISwaggerV20 } from "../structures/ISwaggerV20"; | ||
import { ISwaggerV31 } from "../structures/ISwaggerV31"; | ||
export declare namespace OpenApiConverter { | ||
const v2_0: (swagger: ISwaggerV20) => Promise<ISwagger>; | ||
const v3_1: (swagger: ISwaggerV31) => ISwagger; | ||
} |
{ | ||
"name": "@nestia/migrate", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"description": "Migration program from swagger to NestJS", | ||
@@ -48,3 +48,2 @@ "main": "lib/index.js", | ||
"@types/node": "^20.3.3", | ||
"@types/swagger2openapi": "^7.0.4", | ||
"dotenv": "^16.3.1", | ||
@@ -64,3 +63,2 @@ "dotenv-expand": "^10.0.0", | ||
"prettier": "^3.2.5", | ||
"swagger2openapi": "^7.0.8", | ||
"tstl": "^2.5.13", | ||
@@ -67,0 +65,0 @@ "typescript": "^5.4.2", |
@@ -13,3 +13,2 @@ import typia, { IValidation } from "typia"; | ||
import { ISwagger } from "./structures/ISwagger"; | ||
import { ISwaggerV20 } from "./structures/ISwaggerV20"; | ||
import { ISwaggerV31 } from "./structures/ISwaggerV31"; | ||
@@ -22,9 +21,7 @@ import { OpenApiConverter } from "./utils/OpenApiConverter"; | ||
public static async create( | ||
swagger: ISwagger | ISwaggerV20 | ISwaggerV31, | ||
swagger: ISwagger | ISwaggerV31, | ||
): Promise<IValidation<MigrateApplication>> { | ||
swagger = typia.is<ISwaggerV20.IVersion>(swagger) | ||
? await OpenApiConverter.v2_0(swagger) | ||
: typia.is<ISwaggerV31.IVersion>(swagger) | ||
? OpenApiConverter.v3_1(swagger) | ||
: swagger; | ||
swagger = typia.is<ISwaggerV31.IVersion>(swagger) | ||
? OpenApiConverter.v3_1(swagger) | ||
: swagger; | ||
const result = typia.validate<ISwagger>(swagger); | ||
@@ -31,0 +28,0 @@ if (result.success === false) return result; |
@@ -1,6 +0,6 @@ | ||
import V2_0Converter from "swagger2openapi"; | ||
// import V2_0Converter from "swagger2openapi"; | ||
import typia from "typia"; | ||
import { ISwagger } from "../structures/ISwagger"; | ||
import { ISwaggerV20 } from "../structures/ISwaggerV20"; | ||
// import { ISwaggerV20 } from "../structures/ISwaggerV20"; | ||
import { ISwaggerV31 } from "../structures/ISwaggerV31"; | ||
@@ -10,6 +10,6 @@ import { Converter as V3_1Converter } from "./openapi-down-convert/converter"; | ||
export namespace OpenApiConverter { | ||
export const v2_0 = async (swagger: ISwaggerV20): Promise<ISwagger> => { | ||
const output = await V2_0Converter.convertObj(swagger, {}); | ||
return typia.assert<ISwagger>(output.openapi); | ||
}; | ||
// export const v2_0 = async (swagger: ISwaggerV20): Promise<ISwagger> => { | ||
// const output = await V2_0Converter.convertObj(swagger, {}); | ||
// return typia.assert<ISwagger>(output.openapi); | ||
// }; | ||
@@ -16,0 +16,0 @@ export const v3_1 = (swagger: ISwaggerV31): ISwagger => { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7
19
995881
12703
- Removedswagger2openapi@^7.0.8
- Removed@exodus/schemasafe@1.3.0(transitive)
- Removedcall-me-maybe@1.0.2(transitive)
- Removedcliui@8.0.1(transitive)
- Removedes6-promise@3.3.1(transitive)
- Removedescalade@3.2.0(transitive)
- Removedfast-safe-stringify@2.1.1(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedhttp2-client@1.3.5(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removednode-fetch-h2@2.3.0(transitive)
- Removednode-readfiles@0.2.0(transitive)
- Removedoas-kit-common@1.0.8(transitive)
- Removedoas-linter@3.2.2(transitive)
- Removedoas-resolver@2.5.6(transitive)
- Removedoas-schema-walker@1.1.5(transitive)
- Removedoas-validator@5.0.8(transitive)
- Removedreftools@1.1.9(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedshould@13.2.3(transitive)
- Removedshould-equal@2.0.0(transitive)
- Removedshould-format@3.0.3(transitive)
- Removedshould-type@1.4.0(transitive)
- Removedshould-type-adaptors@1.1.0(transitive)
- Removedshould-util@1.0.1(transitive)
- Removedswagger2openapi@7.0.8(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedy18n@5.0.8(transitive)
- Removedyaml@1.10.2(transitive)
- Removedyargs@17.7.2(transitive)
- Removedyargs-parser@21.1.1(transitive)