Class Resolution<Tag, EnvData, Payload, Async>

Represents a resolution method for an environment.

Each resolution has a unique tag, environment data type, payload type, and a resolve function that handles the actual value resolution.

const hardcodedResolution = Resolution.create(
"hardcoded",
(data) => data.payload
)

Type Parameters

  • Tag extends string

    The unique tag for this resolution method

  • EnvData = any

    The environment data structure

  • Payload = any

    The payload type for this resolution

  • Async extends a.AsyncStatus = a.AsyncStatus

    Whether the resolution is sync or async

Properties

envDataType: TypeDef<EnvData> = ...

Type definition for the environment data structure.

payloadType: TypeDef<Payload> = ...

Type definition for the payload structure.

tag: Tag

The unique tag for this resolution method

resolve: Resolve<EnvData, Payload, Async>

The resolve function for this resolution

Methods

  • Internal

    Creates a new Resolution with the specified tag and resolve function.

    Type Parameters

    • Tag extends string

      The unique tag for this resolution method

    • EnvData

      The environment data structure

    • Payload

      The payload type for this resolution

    • Async extends AsyncStatus = AsyncStatus

      Whether the resolution is sync or async (defaults to AsyncStatus)

    Parameters

    • tag: Tag

      The unique tag for this resolution method

    • resolve: Resolve<EnvData, Payload, Async>

      The resolve function for this resolution

    Returns Resolution<Tag, EnvData, Payload, Async>

    A new Resolution instance

    const hardcodedRes = Resolution.create(
    "hardcoded",
    (data) => data.payload
    )

    const asyncRes = Resolution.create(
    "from-aws-secrets",
    async (data) => {
    await new Promise(resolve => setTimeout(resolve, 1000))
    return `secret for ${data.variableName} from aws`
    }
    )