ts

package
v2.1.1855 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = generator.Generator{
	"client-ts",
	"TypeScript Client",
	"Generate TypeScript client source code",
	[]generator.GeneratorArg{
		{Arg: generator.ArgSpecFile, Required: true},
		{Arg: generator.ArgClient, Required: true, Values: ClientTsValues},
		{Arg: generator.ArgValidation, Required: true, Values: ValidationTsValues},
		{Arg: generator.ArgGeneratePath, Required: true},
	},
	func(specification *spec.Spec, params generator.GeneratorArgsValues) *generator.Sources {
		return client.GenerateClient(specification, params[generator.ArgGeneratePath], params[generator.ArgClient], params[generator.ArgValidation])
	},
}
View Source
var ClientTsValues = []string{"axios", "node-fetch", "browser-fetch"}
View Source
var Models = generator.Generator{
	"models-ts",
	"TypeScript Models",
	"Generate TypeScript models source code",
	[]generator.GeneratorArg{
		{Arg: generator.ArgSpecFile, Required: true},
		{Arg: generator.ArgValidation, Required: true, Values: ValidationTsValues},
		{Arg: generator.ArgGeneratePath, Required: true},
	},
	func(specification *spec.Spec, params generator.GeneratorArgsValues) *generator.Sources {
		return validations.GenerateModels(specification, params[generator.ArgValidation], params[generator.ArgGeneratePath])
	},
}
View Source
var ServerTsValues = []string{"express", "koa"}
View Source
var Service = generator.Generator{
	"service-ts",
	"TypeScript Service",
	"Generate TypeScript client source code",
	[]generator.GeneratorArg{
		{Arg: generator.ArgSpecFile, Required: true},
		{Arg: generator.ArgServer, Required: true, Values: ServerTsValues},
		{Arg: generator.ArgValidation, Required: true, Values: ValidationTsValues},
		{Arg: generator.ArgGeneratePath, Required: true},
		{Arg: generator.ArgServicesPath, Required: false},
		{Arg: generator.ArgSwaggerPath, Required: false},
	},
	func(specification *spec.Spec, params generator.GeneratorArgsValues) *generator.Sources {
		return service.GenerateService(specification, params[generator.ArgSwaggerPath], params[generator.ArgGeneratePath], params[generator.ArgServicesPath], params[generator.ArgServer], params[generator.ArgValidation])
	},
}
View Source
var ValidationTsValues = []string{"superstruct", "io-ts"}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL