giolt_sdk/deploy

Types

pub opaque type Config(has_artifact)
pub type Deployment {
  Deployment(id: String, url: String, preview: Bool)
}

Constructors

  • Deployment(id: String, url: String, preview: Bool)
pub type Error {
  MissingToken(env_var: String)
  ArtifactNotFound(path: String)
  ArtifactEmpty(path: String)
  CannotReadArtifact(path: String)
  NotImplemented(detail: String)
  ApiError(status: Int, body: String)
}

Constructors

  • MissingToken(env_var: String)
  • ArtifactNotFound(path: String)
  • ArtifactEmpty(path: String)
  • CannotReadArtifact(path: String)
  • NotImplemented(detail: String)
  • ApiError(status: Int, body: String)
pub type HasArtifact
pub type NoArtifact
pub type Plan {
  Plan(
    artifact_dir: String,
    preview: Bool,
    token: String,
    message: option.Option(String),
    api_url: String,
  )
}

Constructors

  • Plan(
      artifact_dir: String,
      preview: Bool,
      token: String,
      message: option.Option(String),
      api_url: String,
    )

Values

pub fn api_url(
  config: Config(has_artifact),
  url: String,
) -> Config(has_artifact)
pub fn artifact(
  config: Config(has_artifact),
  path: String,
) -> Config(HasArtifact)
pub fn artifact_files(
  dir: String,
) -> Result(
  #(List(#(String, String)), List(#(String, String))),
  Error,
)

Reads every file under dir, splitting it into worker modules and static assets (files under dir/static). Each entry is #(path, content_base64), with path relative to dir for modules and relative to dir/static for assets — matching what /api/deploy expects.

pub fn describe_error(error: Error) -> String
pub fn from(
  config: Config(has_artifact),
  output: bundle.Output,
) -> Config(HasArtifact)
pub fn message(
  config: Config(has_artifact),
  text: String,
) -> Config(has_artifact)
pub fn new() -> Config(NoArtifact)
pub fn plan(config: Config(HasArtifact)) -> Result(Plan, Error)
pub fn preview(
  config: Config(has_artifact),
  is_preview: Bool,
) -> Config(has_artifact)
pub fn print_result(result: Result(Deployment, Error)) -> Nil
pub fn run(
  config: Config(HasArtifact),
) -> promise.Promise(Result(Deployment, Error))
pub fn token(
  config: Config(has_artifact),
  value: String,
) -> Config(has_artifact)
pub fn token_from_env(
  config: Config(has_artifact),
  var: String,
) -> Config(has_artifact)
Search Document