openapi-typescript
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -0,2 +1,4 @@ | ||
import { OpenAPI2, OpenAPI3, SchemaObject, SwaggerToTSOptions } from "./types"; | ||
export * from "./types"; | ||
export declare const WARNING_MESSAGE = "/**\n* This file was auto-generated by openapi-typescript.\n* Do not make direct changes to the file.\n*/\n\n\n"; | ||
export default function swaggerToTS(schema: OpenAPI2 | OpenAPI3 | Record<string, SchemaObject>, options?: SwaggerToTSOptions): string; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -11,2 +21,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const index_1 = require("./transform/index"); | ||
__exportStar(require("./types"), exports); | ||
exports.WARNING_MESSAGE = `/** | ||
@@ -13,0 +24,0 @@ * This file was auto-generated by openapi-typescript. |
@@ -0,1 +1,2 @@ | ||
import { HeaderObject } from "../types"; | ||
export declare function transformHeaderObjMap(headerMap: Record<string, HeaderObject>): string; |
@@ -0,1 +1,2 @@ | ||
import { OperationObject, ParameterObject, RequestBody } from "../types"; | ||
export declare function transformOperationObj(operation: OperationObject, { version, globalParameters, }: { | ||
@@ -2,0 +3,0 @@ version: number; |
@@ -0,1 +1,2 @@ | ||
import { ParameterObject, ReferenceObject } from "../types"; | ||
export declare function transformParametersArray(parameters: (ReferenceObject | ParameterObject)[], { version, globalParameters, }: { | ||
@@ -2,0 +3,0 @@ version: number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.transformParametersArray = void 0; | ||
const utils_1 = require("../utils"); | ||
const schema_1 = require("./schema"); | ||
const utils_1 = require("../utils"); | ||
function transformParametersArray(parameters, { version, globalParameters, }) { | ||
@@ -7,0 +7,0 @@ let output = ""; |
@@ -0,1 +1,2 @@ | ||
import { OperationObject, ParameterObject, PathItemObject } from "../types"; | ||
interface TransformPathsObjOption { | ||
@@ -2,0 +3,0 @@ operations: Record<string, OperationObject>; |
@@ -0,2 +1,3 @@ | ||
import { RequestBody } from "../types"; | ||
export declare function transformResponsesObj(responsesObj: Record<string, any>): string; | ||
export declare function transformRequestBodies(requestBodies: Record<string, RequestBody>): string; |
@@ -0,1 +1,2 @@ | ||
import { OpenAPI2, OpenAPI3, ReferenceObject } from "./types"; | ||
export declare function comment(text: string): string; | ||
@@ -2,0 +3,0 @@ export declare function fromEntries(entries: [string, any][]): Record<string, unknown>; |
@@ -0,2 +1,4 @@ | ||
import { OpenAPI2, OpenAPI3, SchemaObject, SwaggerToTSOptions } from "./types"; | ||
export * from "./types"; | ||
export declare const WARNING_MESSAGE = "/**\n* This file was auto-generated by openapi-typescript.\n* Do not make direct changes to the file.\n*/\n\n\n"; | ||
export default function swaggerToTS(schema: OpenAPI2 | OpenAPI3 | Record<string, SchemaObject>, options?: SwaggerToTSOptions): string; |
@@ -5,2 +5,3 @@ import path from "path"; | ||
import { transformAll } from "./transform/index"; | ||
export * from "./types"; | ||
export const WARNING_MESSAGE = `/** | ||
@@ -7,0 +8,0 @@ * This file was auto-generated by openapi-typescript. |
@@ -0,1 +1,2 @@ | ||
import { HeaderObject } from "../types"; | ||
export declare function transformHeaderObjMap(headerMap: Record<string, HeaderObject>): string; |
@@ -0,1 +1,2 @@ | ||
import { OperationObject, ParameterObject, RequestBody } from "../types"; | ||
export declare function transformOperationObj(operation: OperationObject, { version, globalParameters, }: { | ||
@@ -2,0 +3,0 @@ version: number; |
@@ -0,1 +1,2 @@ | ||
import { ParameterObject, ReferenceObject } from "../types"; | ||
export declare function transformParametersArray(parameters: (ReferenceObject | ParameterObject)[], { version, globalParameters, }: { | ||
@@ -2,0 +3,0 @@ version: number; |
@@ -0,3 +1,3 @@ | ||
import { comment } from "../utils"; | ||
import { transformSchemaObj } from "./schema"; | ||
import { comment } from "../utils"; | ||
export function transformParametersArray(parameters, { version, globalParameters, }) { | ||
@@ -4,0 +4,0 @@ let output = ""; |
@@ -0,1 +1,2 @@ | ||
import { OperationObject, ParameterObject, PathItemObject } from "../types"; | ||
interface TransformPathsObjOption { | ||
@@ -2,0 +3,0 @@ operations: Record<string, OperationObject>; |
@@ -0,2 +1,3 @@ | ||
import { RequestBody } from "../types"; | ||
export declare function transformResponsesObj(responsesObj: Record<string, any>): string; | ||
export declare function transformRequestBodies(requestBodies: Record<string, RequestBody>): string; |
@@ -0,1 +1,2 @@ | ||
import { OpenAPI2, OpenAPI3, ReferenceObject } from "./types"; | ||
export declare function comment(text: string): string; | ||
@@ -2,0 +3,0 @@ export declare function fromEntries(entries: [string, any][]): Record<string, unknown>; |
{ | ||
"name": "openapi-typescript", | ||
"description": "Generate TypeScript types from Swagger OpenAPI specs", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"engines": { | ||
@@ -26,3 +26,2 @@ "node": ">= 10.0.0" | ||
], | ||
"types": "./types/index.d.ts", | ||
"repository": { | ||
@@ -29,0 +28,0 @@ "type": "git", |
@@ -6,3 +6,3 @@ [![version(scoped)](https://img.shields.io/npm/v/openapi-typescript.svg)](https://www.npmjs.com/package/openapi-typescript) | ||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-30-orange.svg?style=flat-square)](#contributors-) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors-) | ||
<!-- ALL-CONTRIBUTORS-BADGE:END --> | ||
@@ -211,2 +211,3 @@ | ||
<td align="center"><a href="https://github.com/yamacent"><img src="https://avatars.githubusercontent.com/u/8544439?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daisuke Yamamoto</b></sub></a><br /><a href="https://github.com/drwpow/openapi-typescript/commits?author=yamacent" title="Code">💻</a> <a href="https://github.com/drwpow/openapi-typescript/issues?q=author%3Ayamacent" title="Bug reports">🐛</a> <a href="https://github.com/drwpow/openapi-typescript/commits?author=yamacent" title="Tests">⚠️</a></td> | ||
<td align="center"><a href="https://github.com/dnalborczyk"><img src="https://avatars.githubusercontent.com/u/2903325?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dnalborczyk</b></sub></a><br /><a href="https://github.com/drwpow/openapi-typescript/commits?author=dnalborczyk" title="Documentation">📖</a></td> | ||
</tr> | ||
@@ -213,0 +214,0 @@ </table> |
@@ -5,2 +5,4 @@ import path from "path"; | ||
import { transformAll } from "./transform/index"; | ||
import { OpenAPI2, OpenAPI3, SchemaObject, SwaggerToTSOptions } from "./types"; | ||
export * from "./types"; // expose all types to consumers | ||
@@ -7,0 +9,0 @@ export const WARNING_MESSAGE = `/** |
@@ -0,1 +1,2 @@ | ||
import { HeaderObject } from "../types"; | ||
import { comment } from "../utils"; | ||
@@ -2,0 +3,0 @@ import { transformSchemaObj } from "./schema"; |
@@ -0,1 +1,2 @@ | ||
import { OperationObject } from "../types"; | ||
import { comment } from "../utils"; | ||
@@ -2,0 +3,0 @@ import { transformHeaderObjMap } from "./headers"; |
@@ -0,1 +1,2 @@ | ||
import { OperationObject, ParameterObject, RequestBody } from "../types"; | ||
import { comment, isRef, transformRef } from "../utils"; | ||
@@ -2,0 +3,0 @@ import { transformParametersArray } from "./parameters"; |
@@ -0,3 +1,4 @@ | ||
import { ParameterObject, ReferenceObject } from "../types"; | ||
import { comment } from "../utils"; | ||
import { transformSchemaObj } from "./schema"; | ||
import { comment } from "../utils"; | ||
@@ -4,0 +5,0 @@ export function transformParametersArray( |
@@ -0,1 +1,2 @@ | ||
import { OperationObject, ParameterObject, PathItemObject } from "../types"; | ||
import { comment, transformRef } from "../utils"; | ||
@@ -2,0 +3,0 @@ import { transformOperationObj } from "./operation"; |
@@ -0,1 +1,2 @@ | ||
import { RequestBody } from "../types"; | ||
import { comment, transformRef } from "../utils"; | ||
@@ -2,0 +3,0 @@ import { transformHeaderObjMap } from "./headers"; |
@@ -0,1 +1,3 @@ | ||
import { OpenAPI2, OpenAPI3, ReferenceObject } from "./types"; | ||
export function comment(text: string): string { | ||
@@ -2,0 +4,0 @@ const commentText = text.trim(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
152593
77
2339
221