Lightning.MetadataService (Lightning v2.15.0-pre5)

View Source

Retrieves metadata for a given credential and adaptor using the OpenFn CLI.

Summary

Functions

Retrieve metadata for a given adaptor and credential.

Functions

fetch(adaptor, credential, environment \\ "main")

@spec fetch(
  adaptor :: String.t(),
  Lightning.Credentials.Credential.t(),
  environment :: String.t()
) ::
  {:ok, %{optional(binary()) => binary()}}
  | {:error, Lightning.MetadataService.Error.t()}

Retrieve metadata for a given adaptor and credential.

The adaptor must be an npm specification.

Parameters

  • adaptor: The adaptor npm specification (e.g., "@openfn/language-http")
  • credential: The credential struct
  • environment: The environment name (defaults to "main")

Returns

  • {:ok, metadata} - The metadata as a map
  • {:error, Error.t()} - An error if metadata cannot be fetched