Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swagger-axios-codegen

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-axios-codegen - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

dist/template.d.ts

5

CHANGELOG.md

@@ -1,2 +0,5 @@

## 0.2.8
## 0.2.10
- Fix: Enumeration case conversion
## 0.2.9
- Fix: A non-file parameter can be submitted correctly using 'FormData'

@@ -3,0 +6,0 @@

6

CHANGELOG.zh-CN.md

@@ -1,2 +0,6 @@

## 0.2.8
## 0.2.10
- 修复: 枚举名字大小写转换的问题
## 0.2.9
- 修复:使用 FormData 提交 非 file 类型的参数的bug

@@ -3,0 +7,0 @@

@@ -0,0 +0,0 @@ export interface ISwaggerOptions {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -0,0 +0,0 @@ import { IDefinitions } from './baseInterfaces';

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("./utils");
const fp_1 = require("lodash/fp");
const pascalcase_1 = __importDefault(require("pascalcase"));
function propTrueType(v) {

@@ -66,3 +69,3 @@ let propType = '';

if (isEnum) {
let enumName = `Enum${className}${fp_1.capitalize(k)}`;
let enumName = `Enum${className}${pascalcase_1.default(k)}`;
enums.push({

@@ -69,0 +72,0 @@ name: enumName, text: `export enum ${enumName}{

import { ISwaggerOptions } from './baseInterfaces';
export declare function codegen(params: ISwaggerOptions): Promise<void>;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IPaths, ISwaggerOptions } from './baseInterfaces';

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fp_1 = require("lodash/fp");
const camelcase_1 = __importDefault(require("camelcase"));
const pascalcase_1 = __importDefault(require("pascalcase"));
const utils_1 = require("./utils");

@@ -29,3 +33,3 @@ const methodNameChange = { get: 'GET', post: 'POST', put: 'PUT', delete: 'DELETE' };

}
const paramName = fp_1.camelCase(p.name);
const paramName = camelcase_1.default(p.name);
requestParameters += `

@@ -80,6 +84,6 @@ /** ${p.description || ''} */

//参数类型的名字
let methodParamsName = `I${fp_1.capitalize(methodName)}Params`;
let methodParamsName = `I${pascalcase_1.default(methodName)}Params`;
// 如果存在该参数类型的名字,则在参数类型的名字后面+1
if (RequestMethodInputs[methodParamsName]) {
methodParamsName = `I${fp_1.capitalize(methodName)}Params` + RequestMethodInputs[methodParamsName].length;
methodParamsName = `I${pascalcase_1.default(methodName)}Params` + RequestMethodInputs[methodParamsName].length;
}

@@ -89,3 +93,3 @@ else {

}
RequestMethodInputs[`I${fp_1.capitalize(methodName)}Params`].push(`export interface ${methodParamsName}{
RequestMethodInputs[`I${pascalcase_1.default(methodName)}Params`].push(`export interface ${methodParamsName}{
${parsedParameters.requestParameters}

@@ -106,3 +110,3 @@ }`);

*/
${options.useStaticMethod ? 'static' : ''} ${fp_1.camelCase(methodName)}(${parameters}options:IRequestOptions={}):Promise<${responseType}> {
${options.useStaticMethod ? 'static' : ''} ${pascalcase_1.default(methodName)}(${parameters}options:IRequestOptions={}):Promise<${responseType}> {
return new Promise((resolve, reject) => {

@@ -109,0 +113,0 @@ ${handleNullParameters}

@@ -0,0 +0,0 @@ export declare const GENERIC_SPLIT_KEY = "[";

@@ -0,0 +0,0 @@ "use strict";

{
"name": "swagger-axios-codegen",
"version": "0.2.9",
"version": "0.2.10",
"main": "./dist/index",

@@ -21,7 +21,8 @@ "typings": "./dist/",

"axios": "^0.18.0",
"lodash": "^4.17.10",
"camelcase": "^5.0.0",
"pascalcase": "^0.1.1",
"prettier": "^1.12.1"
},
"devDependencies": {
"@types/lodash": "^4.14.113",
"@types/camelcase": "^4.1.0",
"@types/node": "^9.6.0",

@@ -28,0 +29,0 @@ "@types/prettier": "^1.12.2",

# swagger-axios-codegen
[![NpmVersion](https://img.shields.io/npm/v/swagger-axios-codegen.svg)](https://www.npmjs.com/package/swagger-axios-codegen)
[![npm](https://img.shields.io/npm/dt/swagger-axios-codegen.svg)](https://www.npmjs.com/package/swagger-axios-codegen)
require node > v8.0.0

@@ -96,2 +99,2 @@

Welcome PR and commit issue
Welcome PR and commit issue

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc