@openapi-generator-plus/generator-common
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,2 +0,2 @@ | ||
import { CodegenGenerator, CodegenOptions } from '@openapi-generator-plus/types'; | ||
import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types'; | ||
export * from './case-transforms'; | ||
@@ -6,2 +6,3 @@ export * from './http-methods'; | ||
export declare const GroupingStrategies: typeof allGroupingStrategies; | ||
export declare function commonGenerator<O extends CodegenOptions>(): Pick<CodegenGenerator<O>, 'toOperationName'>; | ||
export declare function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName'>; | ||
export declare function apiBasePath(servers: CodegenServer[] | undefined): string; |
@@ -5,2 +5,5 @@ "use strict"; | ||
} | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
@@ -17,2 +20,3 @@ if (mod && mod.__esModule) return mod; | ||
__export(require("./http-methods")); | ||
const url_parse_1 = __importDefault(require("url-parse")); | ||
const allGroupingStrategies = __importStar(require("./operation-grouping")); | ||
@@ -33,1 +37,10 @@ exports.GroupingStrategies = allGroupingStrategies; | ||
exports.commonGenerator = commonGenerator; | ||
function apiBasePath(servers) { | ||
if (!servers || !servers.length) { | ||
return '/'; | ||
} | ||
const server = servers[0]; | ||
const url = new url_parse_1.default(server.url); | ||
return url.pathname; | ||
} | ||
exports.apiBasePath = apiBasePath; |
{ | ||
"name": "@openapi-generator-plus/generator-common", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Common utilities for openapi-generator-plus generators", | ||
@@ -24,3 +24,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@openapi-generator-plus/types": "0.1.1" | ||
"@openapi-generator-plus/types": "0.2.0", | ||
"url-parse": "^1.4.7" | ||
}, | ||
@@ -30,3 +31,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "88a2bab87102887e9a1418390a1090b86a86e303" | ||
"gitHead": "90428fc2a2c1cf2616af85ad530e29bc90829822" | ||
} |
@@ -1,5 +0,6 @@ | ||
import { CodegenGenerator, CodegenOptions } from '@openapi-generator-plus/types' | ||
import { CodegenGenerator, CodegenServer } from '@openapi-generator-plus/types' | ||
import { camelCase } from './case-transforms' | ||
export * from './case-transforms' | ||
export * from './http-methods' | ||
import Url from 'url-parse' | ||
@@ -9,3 +10,3 @@ import * as allGroupingStrategies from './operation-grouping' | ||
export function commonGenerator<O extends CodegenOptions>(): Pick<CodegenGenerator<O>, 'toOperationName'> { | ||
export function commonGenerator<O>(): Pick<CodegenGenerator<O>, 'toOperationName'> { | ||
return { | ||
@@ -24,1 +25,11 @@ | ||
} | ||
export function apiBasePath(servers: CodegenServer[] | undefined): string { | ||
if (!servers || !servers.length) { | ||
return '/' | ||
} | ||
const server = servers[0] | ||
const url = new Url(server.url) | ||
return url.pathname | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
28576
409
0
2
+ Addedurl-parse@^1.4.7
+ Added@openapi-generator-plus/types@0.2.0(transitive)
+ Addedquerystringify@2.2.0(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedurl-parse@1.5.10(transitive)
- Removed@openapi-generator-plus/types@0.1.1(transitive)