Skip to content

TypeScript Function APIDocs


TypeScript Function API / asset_builder / SecretDefinitionBuilder

Class: SecretDefinitionBuilder

Creates a secret to be used with a set of assets

Example

ts
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

SecretDefinitionBuilder

Defined in

asset_builder.ts:940

Properties

definition

definition: SecretDefinition

Defined in

asset_builder.ts:938

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

ts
.setName("DigitalOcean Token")

Implementation of

ISecretDefinitionBuilder.setName

Defined in

asset_builder.ts:957


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

ts
.addProp(new PropBuilder()
    .setName("token")
    .setKind("string")
    .setWidget(new PropWidgetDefinitionBuilder().setKind("password").build())
    .build())

Implementation of

ISecretDefinitionBuilder.addProp

Defined in

asset_builder.ts:976


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

ts
.setConnectionAnnotation("Registry Token")

Defined in

asset_builder.ts:991


build()

build(): SecretDefinition

Returns

SecretDefinition

Implementation of

ISecretDefinitionBuilder.build

Defined in

asset_builder.ts:996