caffeine_lang/parser/blueprints

Types

pub type Blueprint {
  Blueprint(
    name: String,
    artifact_ref: String,
    params: dict.Dict(String, helpers.AcceptedTypes),
    inputs: dict.Dict(String, dynamic.Dynamic),
  )
}

Constructors

Values

pub fn blueprints_from_json(
  json_string: String,
  artifacts: List(artifacts.Artifact),
) -> Result(List(Blueprint), json.DecodeError)
pub fn parse_from_file(
  file_path: String,
  artifacts: List(artifacts.Artifact),
) -> Result(List(Blueprint), errors.CompilationError)

Parse blueprints from a file.

pub fn parse_from_string(
  json_string: String,
  artifacts: List(artifacts.Artifact),
) -> Result(List(Blueprint), errors.CompilationError)

Parse blueprints from a JSON string. This is public so it can be used by browser.gleam for in-browser compilation.

pub fn validate_blueprints(
  blueprints: List(Blueprint),
  artifacts: List(artifacts.Artifact),
) -> Result(List(Blueprint), errors.CompilationError)

Validates and transforms blueprints after JSON parsing. This performs all the validation and merging that parse_from_file does, but takes already-parsed blueprints instead of reading from a file.

Search Document