Skip to content

Latest commit

 

History

History
987 lines (577 loc) · 23.1 KB

PontSpec.md

File metadata and controls

987 lines (577 loc) · 23.1 KB

pontx-spec / Exports / PontSpec

Class: PontSpec

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PontSpec(ds?)

Parameters

Name Type
ds? PontSpec

Defined in

pontx-spec/src/type.ts:937

Properties

apis

apis: ObjectMap<PontAPI>

如果有 namespace,则 map key 可能为 namespace.apiName,否则为 apiName

Defined in

pontx-spec/src/type.ts:241


basePath

Optional basePath: string

Defined in

pontx-spec/src/type.ts:246


definitions

definitions: ObjectMap<PontJsonSchema>

Defined in

pontx-spec/src/type.ts:239


description

Optional description: string

Defined in

pontx-spec/src/type.ts:235


docDirectories

Optional docDirectories: PontxDirectoryNode[]

Defined in

pontx-spec/src/type.ts:285


envs

Optional envs: Object

Index signature

▪ [x: string]: Partial<PontSpec>

Defined in

pontx-spec/src/type.ts:249


ext

Optional ext: any

扩展字段

Defined in

pontx-spec/src/type.ts:288


externalDocs

Optional externalDocs: ExternalDocumentationObject

Defined in

pontx-spec/src/type.ts:248


host

Optional host: string

Defined in

pontx-spec/src/type.ts:247


name

name: string

Defined in

pontx-spec/src/type.ts:234


namespaces

namespaces: Object = {}

Index signature

▪ [x: string]: PontNamespace

Defined in

pontx-spec/src/type.ts:243


pontx

Optional pontx: string = "2.0"

Defined in

pontx-spec/src/type.ts:238


security

Optional security: { [x: string]: string[]; }[]

Defined in

pontx-spec/src/type.ts:252


securitySchemes

Optional securitySchemes: Object

Index signature

▪ [x: string]: { bearerFormat?: string ; description?: string ; flows?: { authorizationCode?: { authorizationUrl: string ; scopes: { [x: string]: string; } ; tokenUrl: string } ; clientCredentials?: { scopes: { [x: string]: string; } ; tokenUrl: string } ; implicit?: { authorizationUrl: string ; scopes: { [x: string]: string; } } ; password?: { scopes: { [x: string]: string; } ; tokenUrl: string } } ; in?: "query" | "header" | "cookie" ; name?: string ; openIdConnectUrl?: string ; scheme?: "basic" | "bearer" ; type?: "apiKey" | "http" | "oauth2" | "openIdConnect" }

Defined in

pontx-spec/src/type.ts:255


title

Optional title: string

Defined in

pontx-spec/src/type.ts:236


version

Optional version: string

Defined in

pontx-spec/src/type.ts:237

Methods

_getSpecInfo

Static _getSpecInfo(spec): { basePath?: string ; description?: string ; docDirectories?: PontxDirectoryNode[] ; envs?: { [x: string]: Partial<PontSpec>; } ; ext?: any ; externalDocs?: ExternalDocumentationObject ; host?: string ; name: string ; pontx?: string = "2.0"; security?: { [x: string]: string[]; }[] ; securitySchemes?: { [x: string]: { bearerFormat?: string ; description?: string ; flows?: { authorizationCode?: { authorizationUrl: string ; scopes: { [x: string]: string; } ; tokenUrl: string } ; clientCredentials?: { scopes: { [x: string]: string; } ; tokenUrl: string } ; implicit?: { authorizationUrl: string ; scopes: { [x: string]: string; } } ; password?: { scopes: { [x: string]: string; } ; tokenUrl: string } } ; in?: "query" | "header" | "cookie" ; name?: string ; openIdConnectUrl?: string ; scheme?: "basic" | "bearer" ; type?: "apiKey" | "http" | "oauth2" | "openIdConnect" }; } ; title?: string ; version?: string } | {}

Parameters

Name Type
spec PontSpec

Returns

{ basePath?: string ; description?: string ; docDirectories?: PontxDirectoryNode[] ; envs?: { [x: string]: Partial<PontSpec>; } ; ext?: any ; externalDocs?: ExternalDocumentationObject ; host?: string ; name: string ; pontx?: string = "2.0"; security?: { [x: string]: string[]; }[] ; securitySchemes?: { [x: string]: { bearerFormat?: string ; description?: string ; flows?: { authorizationCode?: { authorizationUrl: string ; scopes: { [x: string]: string; } ; tokenUrl: string } ; clientCredentials?: { scopes: { [x: string]: string; } ; tokenUrl: string } ; implicit?: { authorizationUrl: string ; scopes: { [x: string]: string; } } ; password?: { scopes: { [x: string]: string; } ; tokenUrl: string } } ; in?: "query" | "header" | "cookie" ; name?: string ; openIdConnectUrl?: string ; scheme?: "basic" | "bearer" ; type?: "apiKey" | "http" | "oauth2" | "openIdConnect" }; } ; title?: string ; version?: string } | {}

Defined in

pontx-spec/src/type.ts:678


addApi

Static addApi(spec, apiName, apiSpec): PontSpec

Parameters

Name Type
spec PontSpec
apiName string
apiSpec PontAPI

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:366


addMod

Static addMod(spec, namespace, title): PontSpec

Parameters

Name Type
spec PontSpec
namespace string
title string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:384


addStruct

Static addStruct(spec, structName, struct): PontSpec

Parameters

Name Type
spec PontSpec
structName string
struct PontAPI

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:375


checkHasMods

Static checkHasMods(spec): boolean

Parameters

Name Type
spec PontSpec

Returns

boolean

Defined in

pontx-spec/src/type.ts:298


constructorByName

Static constructorByName(name): PontSpec

Parameters

Name Type
name string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:943


diff

Static diff(preSpec, newSpec): DiffItem[]

Parameters

Name Type
preSpec PontSpec
newSpec PontSpec

Returns

DiffItem[]

Defined in

pontx-spec/src/type.ts:614


diffSpecs

Static diffSpecs(preSpecs, newSpecs): DiffItem[]

Parameters

Name Type
preSpecs PontSpec[]
newSpecs PontSpec[]

Returns

DiffItem[]

Defined in

pontx-spec/src/type.ts:639


getApisInNamespace

Static getApisInNamespace(spec, namespaceName): string[]

Parameters

Name Type
spec PontSpec
namespaceName string

Returns

string[]

Defined in

pontx-spec/src/type.ts:496


getClazzCnt

Static getClazzCnt(spec): number

Parameters

Name Type
spec PontSpec

Returns

number

Defined in

pontx-spec/src/type.ts:962


getCreatedMetas

Static getCreatedMetas(preSpec, newSpec): DiffItem[]

Parameters

Name Type
preSpec PontSpec
newSpec PontSpec

Returns

DiffItem[]

Defined in

pontx-spec/src/type.ts:899


getDirsDiff

Static getDirsDiff(preSpec, nextSpec): DiffItem[]

Parameters

Name Type
preSpec PontSpec
nextSpec PontSpec

Returns

DiffItem[]

Defined in

pontx-spec/src/type.ts:685


getMetaByKey

Static getMetaByKey(spec, key): PontJsonSchema | PontAPI

Parameters

Name Type Description
spec PontSpec pontx-spec
key string type/namespace/name | type/name

Returns

PontJsonSchema | PontAPI

Defined in

pontx-spec/src/type.ts:733


getMetasDiff

Static getMetasDiff(preSpec, newSpec): DiffItem[]

Parameters

Name Type
preSpec PontSpec
newSpec PontSpec

Returns

DiffItem[]

Defined in

pontx-spec/src/type.ts:744


getModByName

Static getModByName(spec, modName): Mod

Parameters

Name Type
spec PontSpec
modName string

Returns

Mod

Defined in

pontx-spec/src/type.ts:491


getMods

Static getMods(spec): Mod[]

Parameters

Name Type
spec PontSpec

Returns

Mod[]

Defined in

pontx-spec/src/type.ts:504


getNamespaceNames

Static getNamespaceNames(spec): string[]

Parameters

Name Type
spec PontSpec

Returns

string[]

Defined in

pontx-spec/src/type.ts:316


getSubSpecWithAPI

Static getSubSpecWithAPI(spec, controllerName, apiName): PontSpec

Parameters

Name Type
spec PontSpec
controllerName string
apiName string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:844


getSubSpecWithStruct

Static getSubSpecWithStruct(spec, structName): PontSpec

Parameters

Name Type
spec PontSpec
structName string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:858


isEmptySpec

Static isEmptySpec(spec): boolean

Parameters

Name Type
spec PontSpec

Returns

boolean

Defined in

pontx-spec/src/type.ts:954


merge

Static merge(spec1, spec2): PontSpec

Parameters

Name Type
spec1 PontSpec
spec2 PontSpec

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:345


moveApi

Static moveApi(spec, apiName, namespace): PontSpec

Parameters

Name Type
spec PontSpec
apiName string
namespace string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:596


pickSpecByControllers

Static pickSpecByControllers(spec, controllers): PontSpec

Parameters

Name Type
spec PontSpec
controllers string[]

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:819


reNameApi

Static reNameApi(spec, fullApiName, newApiName): PontSpec

Parameters

Name Type
spec PontSpec
fullApiName string
newApiName string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:428


reOrder

Static reOrder(ds): PontSpec

Parameters

Name Type
ds PontSpec

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:290


removeApi

Static removeApi(spec, apiName): PontSpec

Parameters

Name Type
spec PontSpec
apiName string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:396


removeMod

Static removeMod(spec, modName): PontSpec

Parameters

Name Type
spec PontSpec
modName string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:584


removeStruct

Static removeStruct(spec, structName): PontSpec

Parameters

Name Type
spec PontSpec
structName string

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:409


removeUnUsedStructs

Static removeUnUsedStructs(spec): Object

Parameters

Name Type
spec PontSpec

Returns

Object

Name Type Description
apis ObjectMap<PontAPI> 如果有 namespace,则 map key 可能为 namespace.apiName,否则为 apiName
basePath? string -
definitions Dictionary<PontJsonSchema> -
description? string -
docDirectories? PontxDirectoryNode[] -
envs? { [x: string]: Partial<PontSpec>; } -
ext? any 扩展字段
externalDocs? ExternalDocumentationObject -
host? string -
name string -
namespaces { [x: string]: PontNamespace; } -
pontx? string -
security? { [x: string]: string[]; }[] -
securitySchemes? { [x: string]: { bearerFormat?: string ; description?: string ; flows?: { authorizationCode?: { authorizationUrl: string ; scopes: { [x: string]: string; } ; tokenUrl: string } ; clientCredentials?: { scopes: { [x: string]: string; } ; tokenUrl: string } ; implicit?: { authorizationUrl: string ; scopes: { [x: string]: string; } } ; password?: { scopes: { [x: string]: string; } ; tokenUrl: string } } ; in?: "query" | "header" | "cookie" ; name?: string ; openIdConnectUrl?: string ; scheme?: "basic" | "bearer" ; type?: "apiKey" | "http" | "oauth2" | "openIdConnect" }; } -
title? string -
version? string -

Defined in

pontx-spec/src/type.ts:877


serialize

Static serialize(ds): string

Parameters

Name Type
ds PontSpec

Returns

string

Defined in

pontx-spec/src/type.ts:933


udpateApi

Static udpateApi(spec, apiName, apiSpec): PontSpec

Parameters

Name Type
spec PontSpec
apiName string
apiSpec PontAPI

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:419


udpateStruct

Static udpateStruct(spec, structName, struct): PontSpec

Parameters

Name Type
spec PontSpec
structName string
struct PontJsonSchema

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:482


updateMod

Static updateMod(spec, mod): PontSpec

Parameters

Name Type
spec PontSpec
mod Mod

Returns

PontSpec

Defined in

pontx-spec/src/type.ts:565


validateLock

Static validateLock(ds): string[]

Parameters

Name Type
ds PontSpec

Returns

string[]

Defined in

pontx-spec/src/type.ts:928