TypeScript Function API • Docs
TypeScript Function API / asset_builder / SecretDefinitionBuilder
Class: SecretDefinitionBuilder
Creates a secret to be used with a set of assets
Example
const secretDefinition = new SecretDefinitionBuilder()
.setName("DigitalOcean Token")
.setConnectionAnnotations("Registry Token")
.addProp(
new PropBuilder()
.setKind("string")
.setName("token")
.setWidget(
new PropWidgetDefinitionBuilder()
.setKind("password")
.build()
)
.build()
)
.build();
Implements
Constructors
new SecretDefinitionBuilder()
new SecretDefinitionBuilder():
SecretDefinitionBuilder
Returns
Defined in
Properties
definition
definition:
SecretDefinition
Defined in
Methods
setName()
setName(
name
):this
The secret name. This corresponds to the kind of secret
Parameters
• name: string
the name of the secret kind
Returns
this
this
Example
.setName("DigitalOcean Token")
Implementation of
ISecretDefinitionBuilder
.setName
Defined in
addProp()
addProp(
prop
):this
Adds a Prop to the secret definition. These define the form fields for the secret input
Parameters
• prop: PropDefinition
Returns
this
this
Example
.addProp(new PropBuilder()
.setName("token")
.setKind("string")
.setWidget(new PropWidgetDefinitionBuilder().setKind("password").build())
.build())
Implementation of
ISecretDefinitionBuilder
.addProp
Defined in
setConnectionAnnotation()
setConnectionAnnotation(
connectionAnnotations
):this
Adds the specified connection annotations to the output socket for the secret
Parameters
• connectionAnnotations: string
the connection annotations to create for the output socket.
Returns
this
this
Example
.setConnectionAnnotation("Registry Token")
Defined in
build()
build():
SecretDefinition
Returns
Implementation of
ISecretDefinitionBuilder
.build