0.1.1 • Published 1 year ago

@kubenode/crdgen v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@kubenode/crdgen

Utilities for creating Kubernetes CRDs from TypeScript definitions.

Classes

Functions

Typedefs

Model

Class representing a single custom resource model.

Kind: global class

new Model(program, node, config)

Construct a model.

ParamTypeDescription
programts.ProgramTypeScript API Program.
nodets.TypeAliasDeclarationTypeScript API TypeAliasDeclaration node.
configModelCommentConfigModel configuration extracted from JSDoc comments.

model.toCRD() ⇒ ModelCRD

Converts the Model to a CRD object that can be stringified to YAML.

Kind: instance method of Model Returns: ModelCRD - An object representation of the Model as a Kubernetes CRD.

generateModelsFromFiles(filenames) ⇒ Map.<string, Model>

Generates models defined in a collection of files.

Kind: global function

ParamTypeDescription
filenamesArray.<string>The files to extract models from.

getModelConfigFromComments(jsDocs) ⇒ ModelCommentConfig

Extracts a model configuration from JSDoc comments.

Kind: global function

ParamType
jsDocsArray.<any>

ModelCommentConfig : object

Kind: global typedef Properties

NameType
apiVersionstring
descriptionstring
kindstring
isNamespacedboolean
pluralstring
singularstring

ModelCRD : object

Kind: global typedef Properties

NameType
apiVersionstring
kindstring
metadataobject
specobject
0.1.1

1 year ago

0.1.0

1 year ago