pontx-spec / Exports / PontSpec
- apis
- basePath
- definitions
- description
- docDirectories
- envs
- ext
- externalDocs
- host
- name
- namespaces
- pontx
- security
- securitySchemes
- title
- version
- _getSpecInfo
- addApi
- addMod
- addStruct
- checkHasMods
- constructorByName
- diff
- diffSpecs
- getApisInNamespace
- getClazzCnt
- getCreatedMetas
- getDirsDiff
- getMetaByKey
- getMetasDiff
- getModByName
- getMods
- getNamespaceNames
- getSubSpecWithAPI
- getSubSpecWithStruct
- isEmptySpec
- merge
- moveApi
- pickSpecByControllers
- reNameApi
- reOrder
- removeApi
- removeMod
- removeStruct
- removeUnUsedStructs
- serialize
- udpateApi
- udpateStruct
- updateMod
- validateLock
• new PontSpec(ds?
)
Name | Type |
---|---|
ds? |
PontSpec |
如果有 namespace,则 map key 可能为 namespace.apiName,否则为 apiName
• Optional
basePath: string
• definitions: ObjectMap
<PontJsonSchema
>
• Optional
description: string
• Optional
docDirectories: PontxDirectoryNode
[]
• Optional
envs: Object
▪ [x: string
]: Partial
<PontSpec
>
• Optional
ext: any
扩展字段
• Optional
externalDocs: ExternalDocumentationObject
• Optional
host: string
• name: string
• namespaces: Object
= {}
▪ [x: string
]: PontNamespace
• Optional
pontx: string
= "2.0"
• Optional
security: { [x: string]
: string
[]; }[]
• Optional
securitySchemes: Object
▪ [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"
}
• Optional
title: string
• Optional
version: string
▸ 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
} | {}
Name | Type |
---|---|
spec |
PontSpec |
{ 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
} | {}
▸ Static
addApi(spec
, apiName
, apiSpec
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
apiName |
string |
apiSpec |
PontAPI |
▸ Static
addMod(spec
, namespace
, title
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
namespace |
string |
title |
string |
▸ Static
addStruct(spec
, structName
, struct
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
structName |
string |
struct |
PontAPI |
▸ Static
checkHasMods(spec
): boolean
Name | Type |
---|---|
spec |
PontSpec |
boolean
▸ Static
constructorByName(name
): PontSpec
Name | Type |
---|---|
name |
string |
▸ Static
diff(preSpec
, newSpec
): DiffItem
[]
Name | Type |
---|---|
preSpec |
PontSpec |
newSpec |
PontSpec |
DiffItem
[]
▸ Static
diffSpecs(preSpecs
, newSpecs
): DiffItem
[]
Name | Type |
---|---|
preSpecs |
PontSpec [] |
newSpecs |
PontSpec [] |
DiffItem
[]
▸ Static
getApisInNamespace(spec
, namespaceName
): string
[]
Name | Type |
---|---|
spec |
PontSpec |
namespaceName |
string |
string
[]
▸ Static
getClazzCnt(spec
): number
Name | Type |
---|---|
spec |
PontSpec |
number
▸ Static
getCreatedMetas(preSpec
, newSpec
): DiffItem
[]
Name | Type |
---|---|
preSpec |
PontSpec |
newSpec |
PontSpec |
DiffItem
[]
▸ Static
getDirsDiff(preSpec
, nextSpec
): DiffItem
[]
Name | Type |
---|---|
preSpec |
PontSpec |
nextSpec |
PontSpec |
DiffItem
[]
▸ Static
getMetaByKey(spec
, key
): PontJsonSchema
| PontAPI
Name | Type | Description |
---|---|---|
spec |
PontSpec |
pontx-spec |
key |
string |
type/namespace/name | type/name |
▸ Static
getMetasDiff(preSpec
, newSpec
): DiffItem
[]
Name | Type |
---|---|
preSpec |
PontSpec |
newSpec |
PontSpec |
DiffItem
[]
▸ Static
getModByName(spec
, modName
): Mod
Name | Type |
---|---|
spec |
PontSpec |
modName |
string |
▸ Static
getMods(spec
): Mod
[]
Name | Type |
---|---|
spec |
PontSpec |
Mod
[]
▸ Static
getNamespaceNames(spec
): string
[]
Name | Type |
---|---|
spec |
PontSpec |
string
[]
▸ Static
getSubSpecWithAPI(spec
, controllerName
, apiName
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
controllerName |
string |
apiName |
string |
▸ Static
getSubSpecWithStruct(spec
, structName
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
structName |
string |
▸ Static
isEmptySpec(spec
): boolean
Name | Type |
---|---|
spec |
PontSpec |
boolean
▸ Static
merge(spec1
, spec2
): PontSpec
Name | Type |
---|---|
spec1 |
PontSpec |
spec2 |
PontSpec |
▸ Static
moveApi(spec
, apiName
, namespace
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
apiName |
string |
namespace |
string |
▸ Static
pickSpecByControllers(spec
, controllers
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
controllers |
string [] |
▸ Static
reNameApi(spec
, fullApiName
, newApiName
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
fullApiName |
string |
newApiName |
string |
▸ Static
reOrder(ds
): PontSpec
Name | Type |
---|---|
ds |
PontSpec |
▸ Static
removeApi(spec
, apiName
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
apiName |
string |
▸ Static
removeMod(spec
, modName
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
modName |
string |
▸ Static
removeStruct(spec
, structName
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
structName |
string |
▸ Static
removeUnUsedStructs(spec
): Object
Name | Type |
---|---|
spec |
PontSpec |
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 |
- |
▸ Static
serialize(ds
): string
Name | Type |
---|---|
ds |
PontSpec |
string
▸ Static
udpateApi(spec
, apiName
, apiSpec
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
apiName |
string |
apiSpec |
PontAPI |
▸ Static
udpateStruct(spec
, structName
, struct
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
structName |
string |
struct |
PontJsonSchema |
▸ Static
updateMod(spec
, mod
): PontSpec
Name | Type |
---|---|
spec |
PontSpec |
mod |
Mod |
▸ Static
validateLock(ds
): string
[]
Name | Type |
---|---|
ds |
PontSpec |
string
[]