swagger-typescript-api
Advanced tools
Comparing version
#!/usr/bin/env node | ||
import { d, e, a, b, f, g } from './chunk-FPPX3UNW.js'; | ||
import { d, e, a, b, f, g } from './chunk-W6DHQSAC.js'; | ||
import { resolve } from 'node:path'; | ||
@@ -4,0 +4,0 @@ import v from 'lodash'; |
#!/usr/bin/env node | ||
export { c as constants, g as generateApi, f as generateTemplates } from './chunk-FPPX3UNW.js'; | ||
export { c as constants, g as generateApi, f as generateTemplates } from './chunk-W6DHQSAC.js'; | ||
//# sourceMappingURL=lib.js.map | ||
//# sourceMappingURL=lib.js.map |
@@ -1219,3 +1219,3 @@ import * as eta from 'eta'; | ||
/** ts compiler configuration object (for --to-js option) */ | ||
compilerTsConfig?: Record<string, any>; | ||
compilerTsConfig?: Record<string, unknown>; | ||
@@ -1293,18 +1293,18 @@ /** | ||
}; | ||
ArrayType: (content: any) => string; | ||
StringValue: (content: any) => string; | ||
BooleanValue: (content: any) => string; | ||
NumberValue: (content: any) => string; | ||
NullValue: (content: any) => string; | ||
UnionType: (content: any) => string; | ||
ExpressionGroup: (content: any) => string; | ||
IntersectionType: (content: any) => string; | ||
RecordType: (content: any) => string; | ||
TypeField: (content: any) => string; | ||
InterfaceDynamicField: (content: any) => string; | ||
EnumField: (content: any) => string; | ||
EnumFieldsWrapper: (content: any) => string; | ||
ObjectWrapper: (content: any) => string; | ||
MultilineComment: (content: any) => string; | ||
TypeWithGeneric: (content: any) => string; | ||
ArrayType: (content: unknown) => string; | ||
StringValue: (content: unknown) => string; | ||
BooleanValue: (content: unknown) => string; | ||
NumberValue: (content: unknown) => string; | ||
NullValue: (content: unknown) => string; | ||
UnionType: (content: unknown) => string; | ||
ExpressionGroup: (content: unknown) => string; | ||
IntersectionType: (content: unknown) => string; | ||
RecordType: (content: unknown) => string; | ||
TypeField: (content: unknown) => string; | ||
InterfaceDynamicField: (content: unknown) => string; | ||
EnumField: (content: unknown) => string; | ||
EnumFieldsWrapper: (content: unknown) => string; | ||
ObjectWrapper: (content: unknown) => string; | ||
MultilineComment: (content: unknown) => string; | ||
TypeWithGeneric: (content: unknown) => string; | ||
}; | ||
@@ -1315,3 +1315,3 @@ | ||
| (( | ||
schema: Record<string, any>, | ||
schema: Record<string, unknown>, | ||
parser: SchemaParser, | ||
@@ -1379,5 +1379,5 @@ ) => string); | ||
/** calls before parse\process route path */ | ||
onPreBuildRoutePath: (routePath: string) => string | void; | ||
onPreBuildRoutePath: (routePath: string) => string | undefined; | ||
/** calls after parse\process route path */ | ||
onBuildRoutePath: (data: BuildRoutePath) => BuildRoutePath | void; | ||
onBuildRoutePath: (data: BuildRoutePath) => BuildRoutePath | undefined; | ||
/** calls before insert path param name into string path interpolation */ | ||
@@ -1389,15 +1389,20 @@ onInsertPathParam: ( | ||
resultRoute: string, | ||
) => string | void; | ||
) => string | undefined; | ||
/** calls after parse schema component */ | ||
onCreateComponent: (component: SchemaComponent) => SchemaComponent | void; | ||
onCreateComponent: ( | ||
component: SchemaComponent, | ||
) => SchemaComponent | undefined; | ||
/** calls before parse any kind of schema */ | ||
onPreParseSchema: ( | ||
originalSchema: any, | ||
originalSchema: unknown, | ||
typeName: string, | ||
schemaType: string, | ||
) => any; | ||
) => undefined; | ||
/** calls after parse any kind of schema */ | ||
onParseSchema: (originalSchema: any, parsedSchema: any) => any | void; | ||
onParseSchema: ( | ||
originalSchema: unknown, | ||
parsedSchema: unknown, | ||
) => unknown | undefined; | ||
/** calls after parse route (return type: customized route (ParsedRoute), nothing change (void), false (ignore this route)) */ | ||
onCreateRoute: (routeData: ParsedRoute) => ParsedRoute | void | false; | ||
onCreateRoute: (routeData: ParsedRoute) => ParsedRoute | false | undefined; | ||
/** Start point of work this tool (after fetching schema) */ | ||
@@ -1407,7 +1412,7 @@ onInit?: <C extends GenerateApiConfiguration["config"]>( | ||
codeGenProcess: CodeGenProcess, | ||
) => C | void; | ||
) => C | undefined; | ||
/** customize configuration object before sending it to ETA templates */ | ||
onPrepareConfig?: <C extends GenerateApiConfiguration>( | ||
currentConfiguration: C, | ||
) => C | void; | ||
) => C | undefined; | ||
/** customize route name as you need */ | ||
@@ -1417,7 +1422,7 @@ onCreateRouteName?: ( | ||
rawRouteInfo: RawRouteInfo, | ||
) => RouteNameInfo | void; | ||
) => RouteNameInfo | undefined; | ||
/** customize request params (path params, query params) */ | ||
onCreateRequestParams?: ( | ||
rawType: SchemaComponent["rawTypeData"], | ||
) => SchemaComponent["rawTypeData"] | void; | ||
) => SchemaComponent["rawTypeData"] | undefined; | ||
/** customize name of model type */ | ||
@@ -1428,3 +1433,3 @@ onFormatTypeName?: ( | ||
schemaType?: "type-name" | "enum-key", | ||
) => string | void; | ||
) => string | undefined; | ||
/** customize name of route (operationId), you can do it with using onCreateRouteName too */ | ||
@@ -1434,6 +1439,6 @@ onFormatRouteName?: ( | ||
templateRouteName: string, | ||
) => string | void; | ||
) => string | undefined; | ||
} | ||
type RouteNameRouteInfo = {}; | ||
type RouteNameRouteInfo = Record<unknown, unknown>; | ||
@@ -1451,3 +1456,3 @@ type RouteNameInfo = { | ||
typeIdentifier: string; | ||
name?: any; | ||
name?: unknown; | ||
description: string; | ||
@@ -1638,3 +1643,3 @@ content: string; | ||
url: string; | ||
spec: any; | ||
spec: unknown; | ||
fileName: string; | ||
@@ -1696,3 +1701,3 @@ templatePaths: { | ||
version: string; | ||
compilerTsConfig: Record<string, any>; | ||
compilerTsConfig: Record<string, unknown>; | ||
enumKeyResolverName: string; | ||
@@ -1699,0 +1704,0 @@ typeNameResolverName: string; |
{ | ||
"name": "swagger-typescript-api", | ||
"version": "13.0.14", | ||
"version": "13.0.15", | ||
"description": "Generate the API client for Fetch or Axios from an OpenAPI Specification", | ||
@@ -37,12 +37,2 @@ "homepage": "https://github.com/acacode/swagger-typescript-api", | ||
], | ||
"scripts": { | ||
"build": "tsup", | ||
"ci": "biome ci .", | ||
"cli:help": "node index.js -h", | ||
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts", | ||
"cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts", | ||
"format": "biome format --write .", | ||
"format:check": "biome format .", | ||
"test": "vitest run" | ||
}, | ||
"dependencies": { | ||
@@ -69,3 +59,3 @@ "@types/swagger-schema-official": "^2.0.25", | ||
"@types/lodash": "4.17.7", | ||
"@types/node": "22.0.0", | ||
"@types/node": "22.0.2", | ||
"@types/swagger2openapi": "7.0.4", | ||
@@ -75,5 +65,4 @@ "axios": "1.7.2", | ||
"tsup": "8.2.3", | ||
"vitest": "2.0.4" | ||
"vitest": "2.0.5" | ||
}, | ||
"packageManager": "yarn@4.3.1", | ||
"engines": { | ||
@@ -84,4 +73,15 @@ "node": ">=18.0.0" | ||
"access": "public", | ||
"provenance": true, | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"scripts": { | ||
"build": "tsup", | ||
"cli:help": "node index.js -h", | ||
"cli:json": "node index.js -r -d -p ./swagger-test-cli.json -n swagger-test-cli.ts", | ||
"cli:yaml": "node index.js -r -d -p ./swagger-test-cli.yaml -n swagger-test-cli.ts", | ||
"format": "biome format --write .", | ||
"format:check": "biome format .", | ||
"lint": "biome check", | ||
"test": "vitest run" | ||
} | ||
} |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1024138
0.06%2531
0.24%