diff --git a/Lightning.Accounts.html b/Lightning.Accounts.html index e53adc6c13..6ffe318070 100644 --- a/Lightning.Accounts.html +++ b/Lightning.Accounts.html @@ -642,10 +642,10 @@
iex> apply_user_email(user, "valid password", %{email: ...})
-{:ok, %User{}}role: :superuser
-iex> apply_user_email(user, "invalid password", %{email: ...})
-{:error, %Ecto.Changeset{}}
+iex> apply_user_email(user, "valid password", %{email: ...})
+{:ok, %User{}}role: :superuser
+iex> apply_user_email(user, "invalid password", %{email: ...})
+{:error, %Ecto.Changeset{}}
iex> change_scheduled_deletion(user)
-%Ecto.Changeset{data: %User{}}
+iex> change_scheduled_deletion(user)
+%Ecto.Changeset{data: %User{}}
iex> change_superuser_registration(user)
-%Ecto.Changeset{data: %User{}}
+iex> change_superuser_registration(user)
+%Ecto.Changeset{data: %User{}}
iex> change_user_email(user)
-%Ecto.Changeset{data: %User{}}
+iex> change_user_email(user)
+%Ecto.Changeset{data: %User{}}
iex> change_user_password(user)
-%Ecto.Changeset{data: %User{}}
+iex> change_user_password(user)
+%Ecto.Changeset{data: %User{}}
iex> change_user_registration(user)
-%Ecto.Changeset{data: %User{}}
+iex> change_user_registration(user)
+%Ecto.Changeset{data: %User{}}
iex> delete_token(token)
-{:ok, %UserToken{}}
+iex> delete_token(token)
+{:ok, %UserToken{}}
-iex> delete_token(token)
-{:error, %Ecto.Changeset{}}
+iex> delete_token(token)
+{:error, %Ecto.Changeset{}}
iex> delete_user(user)
-{:ok, %User{}}
+iex> delete_user(user)
+{:ok, %User{}}
-iex> delete_user(user)
-{:error, %Ecto.Changeset{}}
+iex> delete_user(user)
+{:error, %Ecto.Changeset{}}
iex> deliver_update_email_instructions(user, current_email, &Routes.user_update_email_url(conn, :edit, &1))
-{:ok, %{to: ..., body: ...}}
+iex> deliver_update_email_instructions(user, current_email, &Routes.user_update_email_url(conn, :edit, &1))
+{:ok, %{to: ..., body: ...}}
iex> deliver_user_confirmation_instructions(user, &Routes.user_confirmation_url(conn, :edit, &1))
-{:ok, %{to: ..., body: ...}}
+iex> deliver_user_confirmation_instructions(user, &Routes.user_confirmation_url(conn, :edit, &1))
+{:ok, %{to: ..., body: ...}}
-iex> deliver_user_confirmation_instructions(confirmed_user, &Routes.user_confirmation_url(conn, :edit, &1))
-{:error, :already_confirmed}
+iex> deliver_user_confirmation_instructions(confirmed_user, &Routes.user_confirmation_url(conn, :edit, &1))
+{:error, :already_confirmed}
iex> deliver_user_reset_password_instructions(user, &Routes.user_reset_password_url(conn, :edit, &1))
-{:ok, %{to: ..., body: ...}}
+iex> deliver_user_reset_password_instructions(user, &Routes.user_reset_password_url(conn, :edit, &1))
+{:ok, %{to: ..., body: ...}}
iex> get_token!(123)
-%UserToken{}
+iex> get_token!(123)
+%UserToken{}
-iex> get_token!(456)
+iex> get_token!(456)
** (Ecto.NoResultsError)
iex> get_user!(123)
-%User{}
+iex> get_user!(123)
+%User{}
-iex> get_user!(456)
+iex> get_user!(456)
** (Ecto.NoResultsError)
@@ -1348,10 +1348,10 @@ get_user_by_email(email)
Examples
-iex> get_user_by_email("foo@example.com")
-%User{}
+iex> get_user_by_email("foo@example.com")
+%User{}
-iex> get_user_by_email("unknown@example.com")
+iex> get_user_by_email("unknown@example.com")
nil
@@ -1380,10 +1380,10 @@ get_user_by_email_and_password(email, passw
Examples
-iex> get_user_by_email_and_password("foo@example.com", "correct_password")
-%User{}
+iex> get_user_by_email_and_password("foo@example.com", "correct_password")
+%User{}
-iex> get_user_by_email_and_password("foo@example.com", "invalid_password")
+iex> get_user_by_email_and_password("foo@example.com", "invalid_password")
nil
@@ -1412,10 +1412,10 @@ get_user_by_reset_password_token(token)
Examples
-iex> get_user_by_reset_password_token("validtoken")
-%User{}
+iex> get_user_by_reset_password_token("validtoken")
+%User{}
-iex> get_user_by_reset_password_token("invalidtoken")
+iex> get_user_by_reset_password_token("invalidtoken")
nil
@@ -1583,8 +1583,8 @@ list_users()
Examples
-iex> list_users()
-[%User{}, ...]
+iex> list_users()
+[%User{}, ...]
@@ -1662,11 +1662,11 @@ register_superuser(attrs)
Examples
-iex> register_superuser(%{field: value})
-{:ok, %User{}}
+iex> register_superuser(%{field: value})
+{:ok, %User{}}
-iex> register_superuser(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> register_superuser(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -1704,11 +1704,11 @@ register_user(attrs)
Examples
-iex> register_user(%{field: value})
-{:ok, %User{}}
+iex> register_user(%{field: value})
+{:ok, %User{}}
-iex> register_user(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> register_user(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -1736,11 +1736,11 @@ reset_user_password(user, attrs)
Examples
-iex> reset_user_password(user, %{password: "new long password", password_confirmation: "new long password"})
-{:ok, %User{}}
+iex> reset_user_password(user, %{password: "new long password", password_confirmation: "new long password"})
+{:ok, %User{}}
-iex> reset_user_password(user, %{password: "valid", password_confirmation: "not the same"})
-{:error, %Ecto.Changeset{}}
+iex> reset_user_password(user, %{password: "valid", password_confirmation: "not the same"})
+{:error, %Ecto.Changeset{}}
@@ -1840,11 +1840,11 @@ update_user_password(user, password, attrs)
Examples
-iex> update_user_password(user, "valid password", %{password: ...})
-{:ok, %User{}}
+iex> update_user_password(user, "valid password", %{password: ...})
+{:ok, %User{}}
-iex> update_user_password(user, "invalid password", %{password: ...})
-{:error, %Ecto.Changeset{}}
+iex> update_user_password(user, "invalid password", %{password: ...})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.AdaptorRegistry.Npm.html b/Lightning.AdaptorRegistry.Npm.html
index d963967bde..a9f4e4cb71 100644
--- a/Lightning.AdaptorRegistry.Npm.html
+++ b/Lightning.AdaptorRegistry.Npm.html
@@ -1659,14 +1659,14 @@ request(request)
Examples
-request = %HTTPoison.Request{
+request = %HTTPoison.Request{
method: :post,
url: "https://my.website.com",
body: "{\"foo\": 3}",
- headers: [{"Accept", "application/json"}]
-}
+ headers: [{"Accept", "application/json"}]
+}
-request(request)
+request(request)
@@ -1724,7 +1724,7 @@ request(method, url, body \\ "",
Examples
-request(:post, "https://my.website.com", "{\"foo\": 3}", [{"Accept", "application/json"}])
+request(:post, "https://my.website.com", "{\"foo\": 3}", [{"Accept", "application/json"}])
diff --git a/Lightning.AdaptorRegistry.html b/Lightning.AdaptorRegistry.html
index 301e391b32..1af410449d 100644
--- a/Lightning.AdaptorRegistry.html
+++ b/Lightning.AdaptorRegistry.html
@@ -117,9 +117,9 @@
Registry process to query and maintain a list of adaptors available for
writing jobs.
Currently it queries NPM for all modules in the @openfn
organization and
filters out modules that are known not to be adaptors.
Usage
# Starting the process
-AdaptorRegistry.start_link()
+AdaptorRegistry.start_link()
# Getting a list of all adaptors
-Lightning.AdaptorRegistry.AdaptorRegistry.all()
Caching
By default the results are cached to disk, and will be reused every start.
In order to disable or configure caching pass see: start_link/1
.
The process uses :continue
to return before the adaptors have been queried.
+
Lightning.AdaptorRegistry.AdaptorRegistry.all()
Caching
By default the results are cached to disk, and will be reused every start.
In order to disable or configure caching pass see: start_link/1
.
The process uses :continue
to return before the adaptors have been queried.
This does mean that the first call to the process will be delayed until
the handle_continue/2
has finished.
Timeouts
There is a 'general' timeout of 30s, this is used for GenServer calls like
all/1
and also internally when the modules are being queried. NPM can
@@ -411,10 +411,10 @@
resolve_package_name(package_name)
-Destructures an NPM style package name into module name and version.
Example
iex> resolve_package_name("@openfn/language-salesforce@1.2.3")
-{ "@openfn/language-salesforce", "1.2.3" }
-iex> resolve_package_name("@openfn/language-salesforce")
-{ "@openfn/language-salesforce", nil }
+Destructures an NPM style package name into module name and version.
Example
iex> resolve_package_name("@openfn/language-salesforce@1.2.3")
+{ "@openfn/language-salesforce", "1.2.3" }
+iex> resolve_package_name("@openfn/language-salesforce")
+{ "@openfn/language-salesforce", nil }
diff --git a/Lightning.AttemptService.html b/Lightning.AttemptService.html
index 45e4c9fc11..580181174d 100644
--- a/Lightning.AttemptService.html
+++ b/Lightning.AttemptService.html
@@ -354,11 +354,11 @@ create_attempt(work_order, job, reason)
Examples
-iex> create_attempt(%{field: value})
-{:ok, %Attempt{}}
+iex> create_attempt(%{field: value})
+{:ok, %Attempt{}}
-iex> create_attempt(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_attempt(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.AuthProviders.WellKnown.html b/Lightning.AuthProviders.WellKnown.html
index 898c1ec45d..e2b88cf028 100644
--- a/Lightning.AuthProviders.WellKnown.html
+++ b/Lightning.AuthProviders.WellKnown.html
@@ -1834,14 +1834,14 @@ request(request)
Examples
-request = %HTTPoison.Request{
+request = %HTTPoison.Request{
method: :post,
url: "https://my.website.com",
body: "{\"foo\": 3}",
- headers: [{"Accept", "application/json"}]
-}
+ headers: [{"Accept", "application/json"}]
+}
-request(request)
+request(request)
@@ -1899,7 +1899,7 @@ request(method, url, body \\ "",
Examples
-request(:post, "https://my.website.com", "{\"foo\": 3}", [{"Accept", "application/json"}])
+request(:post, "https://my.website.com", "{\"foo\": 3}", [{"Accept", "application/json"}])
diff --git a/Lightning.CLI.Result.html b/Lightning.CLI.Result.html
index 1b2774f788..c6ba0732b7 100644
--- a/Lightning.CLI.Result.html
+++ b/Lightning.CLI.Result.html
@@ -121,7 +121,7 @@
Logs
The OpenFn CLI returns JSON formatted log lines, which are decoded and added
-to a Result
struct.
There are two kinds of output:
{"level":"<<level>>","name":"<<module>>","message":"..."],"time":<<timestamp>>}
These are usually for general logging, and debugging.
{"message":["<<message|filepath|output>>"]}
The above is the equivalent of the output of a command
+to a Result
struct.There are two kinds of output:
{"level":"<<level>>","name":"<<module>>","message":"..."],"time":<<timestamp>>}
These are usually for general logging, and debugging.
{"message":["<<message|filepath|output>>"]}
The above is the equivalent of the output of a command
diff --git a/Lightning.Credentials.html b/Lightning.Credentials.html
index b3f7bb1969..9184c7de24 100644
--- a/Lightning.Credentials.html
+++ b/Lightning.Credentials.html
@@ -277,8 +277,8 @@ change_credential(credential, attrs \\ %{})
Examples
-iex> change_credential(credential)
-%Ecto.Changeset{data: %Credential{}}
+iex> change_credential(credential)
+%Ecto.Changeset{data: %Credential{}}
@@ -308,11 +308,11 @@ create_credential(attrs \\ %{})
Examples
-iex> create_credential(%{field: value})
-{:ok, %Credential{}}
+iex> create_credential(%{field: value})
+{:ok, %Credential{}}
-iex> create_credential(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_credential(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -340,11 +340,11 @@ delete_credential(credential)
Examples
-iex> delete_credential(credential)
-{:ok, %Credential{}}
+iex> delete_credential(credential)
+{:ok, %Credential{}}
-iex> delete_credential(credential)
-{:error, %Ecto.Changeset{}}
+iex> delete_credential(credential)
+{:error, %Ecto.Changeset{}}
@@ -372,10 +372,10 @@ get_credential!(id)
Examples
-iex> get_credential!(123)
-%Credential{}
+iex> get_credential!(123)
+%Credential{}
-iex> get_credential!(456)
+iex> get_credential!(456)
** (Ecto.NoResultsError)
@@ -406,11 +406,11 @@ invalid_projects_for_user(credential_id, us
Examples
-iex> can_credential_be_shared_to_user(credential_id, user_id)
-[]
+iex> can_credential_be_shared_to_user(credential_id, user_id)
+[]
-iex> can_credential_be_shared_to_user(credential_id, user_id)
-["52ea8758-6ce5-43d7-912f-6a1e1f11dc55"]
+iex> can_credential_be_shared_to_user(credential_id, user_id)
+["52ea8758-6ce5-43d7-912f-6a1e1f11dc55"]
@@ -438,8 +438,8 @@ list_credentials()
Examples
-iex> list_credentials()
-[%Credential{}, ...]
+iex> list_credentials()
+[%Credential{}, ...]
@@ -489,8 +489,8 @@ list_credentials_for_user(user_id)
Examples
-iex> list_credentials_for_user(123)
-[%Credential{user_id: 123}, %Credential{user_id: 123},...]
+iex> list_credentials_for_user(123)
+[%Credential{user_id: 123}, %Credential{user_id: 123},...]
@@ -576,11 +576,11 @@ update_credential(credential, attrs)
Examples
-iex> update_credential(credential, %{field: new_value})
-{:ok, %Credential{}}
+iex> update_credential(credential, %{field: new_value})
+{:ok, %Credential{}}
-iex> update_credential(credential, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_credential(credential, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.Invocation.html b/Lightning.Invocation.html
index b4c815b22c..c1b1e31f80 100644
--- a/Lightning.Invocation.html
+++ b/Lightning.Invocation.html
@@ -476,8 +476,8 @@ change_dataclip(dataclip, attrs \\ %{})
Examples
-iex> change_dataclip(dataclip)
-%Ecto.Changeset{data: %Dataclip{}}
+iex> change_dataclip(dataclip)
+%Ecto.Changeset{data: %Dataclip{}}
@@ -507,8 +507,8 @@ change_run(run, attrs \\ %{})
Examples
-iex> change_run(run)
-%Ecto.Changeset{data: %Run{}}
+iex> change_run(run)
+%Ecto.Changeset{data: %Run{}}
@@ -546,11 +546,11 @@ create_dataclip(attrs \\ %{})
Examples
-iex> create_dataclip(%{field: value})
-{:ok, %Dataclip{}}
+iex> create_dataclip(%{field: value})
+{:ok, %Dataclip{}}
-iex> create_dataclip(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_dataclip(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -602,11 +602,11 @@ create_run(attrs \\ %{})
Examples
-iex> create_run(%{field: value})
-{:ok, %Run{}}
+iex> create_run(%{field: value})
+{:ok, %Run{}}
-iex> create_run(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_run(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -634,11 +634,11 @@ delete_dataclip(dataclip)
Examples
-iex> delete_dataclip(dataclip)
-{:ok, %Dataclip{}}
+iex> delete_dataclip(dataclip)
+{:ok, %Dataclip{}}
-iex> delete_dataclip(dataclip)
-{:error, %Ecto.Changeset{}}
+iex> delete_dataclip(dataclip)
+{:error, %Ecto.Changeset{}}
@@ -666,11 +666,11 @@ delete_run(run)
Examples
-iex> delete_run(run)
-{:ok, %Run{}}
+iex> delete_run(run)
+{:ok, %Run{}}
-iex> delete_run(run)
-{:error, %Ecto.Changeset{}}
+iex> delete_run(run)
+{:error, %Ecto.Changeset{}}
@@ -859,14 +859,14 @@ get_dataclip(run)
Examples
-iex> get_dataclip("27b73932-16c7-4a72-86a3-85d805ccff98")
-%Dataclip{}
+iex> get_dataclip("27b73932-16c7-4a72-86a3-85d805ccff98")
+%Dataclip{}
-iex> get_dataclip("27b73932-16c7-4a72-86a3-85d805ccff98")
+iex> get_dataclip("27b73932-16c7-4a72-86a3-85d805ccff98")
nil
-iex> get_dataclip(%Run{id: "a uuid"})
-%Dataclip{}
+iex> get_dataclip(%Run{id: "a uuid"})
+%Dataclip{}
@@ -900,10 +900,10 @@ get_dataclip!(id)
Examples
-iex> get_dataclip!(123)
-%Dataclip{}
+iex> get_dataclip!(123)
+%Dataclip{}
-iex> get_dataclip!(456)
+iex> get_dataclip!(456)
** (Ecto.NoResultsError)
@@ -982,10 +982,10 @@ get_run!(id)
Examples
-iex> get_run!(123)
-%Run{}
+iex> get_run!(123)
+%Run{}
-iex> get_run!(456)
+iex> get_run!(456)
** (Ecto.NoResultsError)
@@ -1064,8 +1064,8 @@ list_dataclips()
Examples
-iex> list_dataclips()
-[%Dataclip{}, ...]
+iex> list_dataclips()
+[%Dataclip{}, ...]
@@ -1174,8 +1174,8 @@ list_runs()
Examples
-iex> list_runs()
-[%Run{}, ...]
+iex> list_runs()
+[%Run{}, ...]
@@ -1330,11 +1330,11 @@ update_dataclip(dataclip, attrs)
Examples
-iex> update_dataclip(dataclip, %{field: new_value})
-{:ok, %Dataclip{}}
+iex> update_dataclip(dataclip, %{field: new_value})
+{:ok, %Dataclip{}}
-iex> update_dataclip(dataclip, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_dataclip(dataclip, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -1362,11 +1362,11 @@ update_run(run, attrs)
Examples
-iex> update_run(run, %{field: new_value})
-{:ok, %Run{}}
+iex> update_run(run, %{field: new_value})
+{:ok, %Run{}}
-iex> update_run(run, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_run(run, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.InvocationReasons.html b/Lightning.InvocationReasons.html
index 83af502e07..c94492d93a 100644
--- a/Lightning.InvocationReasons.html
+++ b/Lightning.InvocationReasons.html
@@ -273,11 +273,11 @@ create_reason(attrs \\ %{})
Examples
-iex> create_reason(%{field: value})
-{:ok, %InvocationReason{}}
+iex> create_reason(%{field: value})
+{:ok, %InvocationReason{}}
-iex> create_reason(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_reason(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.Jobs.Job.html b/Lightning.Jobs.Job.html
index 00ecd1fa85..32f9f68408 100644
--- a/Lightning.Jobs.Job.html
+++ b/Lightning.Jobs.Job.html
@@ -336,17 +336,17 @@ put_workflow(changeset, workflow)
Attaches a workflow to a job, this is useful when you have an unpersisted
Workflow changeset - and want it to be created at the same time as a Job.
Example:
workflow =
- Ecto.Changeset.cast(
- %Lightning.Workflows.Workflow{},
- %{ "project_id" => attrs[:project_id], "id" => Ecto.UUID.generate() },
- [:project_id, :id]
- )
+ Ecto.Changeset.cast(
+ %Lightning.Workflows.Workflow{},
+ %{ "project_id" => attrs[:project_id], "id" => Ecto.UUID.generate() },
+ [:project_id, :id]
+ )
job =
- %Job{}
- |> Ecto.Changeset.change()
- |> Job.put_workflow(workflow)
- |> Job.changeset(attrs)
+ %Job{}
+ |> Ecto.Changeset.change()
+ |> Job.put_workflow(workflow)
+ |> Job.changeset(attrs)
diff --git a/Lightning.Jobs.html b/Lightning.Jobs.html
index 66339dd698..2803b29628 100644
--- a/Lightning.Jobs.html
+++ b/Lightning.Jobs.html
@@ -295,8 +295,8 @@ change_job(job, attrs \\ %{})
Examples
-iex> change_job(job)
-%Ecto.Changeset{data: %Job{}}
+iex> change_job(job)
+%Ecto.Changeset{data: %Job{}}
@@ -326,11 +326,11 @@ create_job(attrs \\ %{})
Examples
-iex> create_job(%{field: value})
-{:ok, %Job{}}
+iex> create_job(%{field: value})
+{:ok, %Job{}}
-iex> create_job(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_job(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -358,11 +358,11 @@ delete_job(job)
Examples
-iex> delete_job(job)
-{:ok, %Job{}}
+iex> delete_job(job)
+{:ok, %Job{}}
-iex> delete_job(job)
-{:error, %Ecto.Changeset{}}
+iex> delete_job(job)
+{:error, %Ecto.Changeset{}}
@@ -448,10 +448,10 @@ get_job!(id)
Examples
-iex> get_job!(123)
-%Job{}
+iex> get_job!(123)
+%Job{}
-iex> get_job!(456)
+iex> get_job!(456)
** (Ecto.NoResultsError)
@@ -637,11 +637,11 @@ update_job(job, attrs)
Examples
-iex> update_job(job, %{field: new_value})
-{:ok, %Job{}}
+iex> update_job(job, %{field: new_value})
+{:ok, %Job{}}
-iex> update_job(job, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_job(job, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.Pipeline.StateAssembler.html b/Lightning.Pipeline.StateAssembler.html
index 1042740ebd..9b28109bde 100644
--- a/Lightning.Pipeline.StateAssembler.html
+++ b/Lightning.Pipeline.StateAssembler.html
@@ -121,7 +121,7 @@
How state is assembled
For the most common jobs, an inbound webhook will store an :http_request
type
-dataclip. The reason that is created is associated with the dataclip.
At runtime, the initial state for a Run will be in the shape of:
{ "data": <the dataclip>, "configuration": <the job's credential> }
+dataclip. The reason that is created is associated with the dataclip.
At runtime, the initial state for a Run will be in the shape of:
{ "data": <the dataclip>, "configuration": <the job's credential> }
saved-inputs
diff --git a/Lightning.Policies.Permissions.html b/Lightning.Policies.Permissions.html
index abaece69a1..beef404233 100644
--- a/Lightning.Policies.Permissions.html
+++ b/Lightning.Policies.Permissions.html
@@ -115,13 +115,13 @@
This module defines a unique interface managing authorizations in Lightning.
Users in Lightning have instance-wide and project-wide roles which determine their level of access to resources in the application. Fo rmore details see the documentation.
These authorizations policies are all implemented under the lib/lightning/policies
folder. In that folder you can find 3 files:
- The
users.ex
file has all the policies for the instances wide access levels - The
project_users.ex
file has all the policies for the project wide access levels - The
permissions.ex
file defines the Lightning.Policies.Permissions.can/4
interface. Which is a wrapper around the Bodyguard.permit/4
function.
-We use that interface to be able to harmonize the use of policies accross the entire app.
All the policies are tested in the test/lightning/policies
folder. And the test are written in a way that allows the reader to quickly who can do what in the app.
We have two variants of the Lightning.Policies.Permissions.can/4
interface:
Lightning.Policies.Permissions.can(policy, action, actor, resource)
returns :ok
if the actor can perform the action on the resource and {:error, :unauthorized}
otherwise.Lightning.Policies.Permissions.can?(policy, action, actor, resource)
returns true
if the actor can perform the action on the resource and false
otherwise.
Here is an example of how we the Lightning.Policies.Permissions.can/4
interface to check if the a user can edit a job or not
can_edit_job = Lightning.Policies.ProjectUsers |> Lightning.Policies.Permissions.can?(:edit_job, socket.assigns.current_user, socket.assigns.project)
+We use that interface to be able to harmonize the use of policies accross the entire app.All the policies are tested in the test/lightning/policies
folder. And the test are written in a way that allows the reader to quickly who can do what in the app.
We have two variants of the Lightning.Policies.Permissions.can/4
interface:
Lightning.Policies.Permissions.can(policy, action, actor, resource)
returns :ok
if the actor can perform the action on the resource and {:error, :unauthorized}
otherwise.Lightning.Policies.Permissions.can?(policy, action, actor, resource)
returns true
if the actor can perform the action on the resource and false
otherwise.
Here is an example of how we the Lightning.Policies.Permissions.can/4
interface to check if the a user can edit a job or not
can_edit_job = Lightning.Policies.ProjectUsers |> Lightning.Policies.Permissions.can?(:edit_job, socket.assigns.current_user, socket.assigns.project)
-if can_edit_job do
+if can_edit_job do
# allow user to edit the job
-else
+else
# quick user out
-end
+end
@@ -199,11 +199,11 @@ can(policy, action, user, params \\ [])
Examples
-iex> can(Lightning.Policies.Users, :create_workflow, user, project)
+iex> can(Lightning.Policies.Users, :create_workflow, user, project)
:ok
-iex> can(Lightning.Policies.Users, :create_project, user, %{})
-{:error, :unauthorized}
+iex> can(Lightning.Policies.Users, :create_project, user, %{})
+{:error, :unauthorized}
@@ -233,10 +233,10 @@ can?(policy, action, user, params \\ [])
Examples
-iex> can(Lightning.Policies.Users, :create_workflow, user, project)
+iex> can(Lightning.Policies.Users, :create_workflow, user, project)
true
-iex> can(Lightning.Policies.Users, :create_project, user, %{})
+iex> can(Lightning.Policies.Users, :create_project, user, %{})
false
diff --git a/Lightning.Projects.html b/Lightning.Projects.html
index b6c3f79b5e..86366e8aec 100644
--- a/Lightning.Projects.html
+++ b/Lightning.Projects.html
@@ -540,8 +540,8 @@ change_project(project, attrs \\ %{})
Examples
-iex> change_project(project)
-%Ecto.Changeset{data: %Project{}}
+iex> change_project(project)
+%Ecto.Changeset{data: %Project{}}
@@ -571,11 +571,11 @@ create_project(attrs \\ %{})
Examples
-iex> create_project(%{field: value})
-{:ok, %Project{}}
+iex> create_project(%{field: value})
+{:ok, %Project{}}
-iex> create_project(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_project(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -604,11 +604,11 @@ delete_project(project)
Examples
-iex> delete_project(project)
-{:ok, %Project{}}
+iex> delete_project(project)
+{:ok, %Project{}}
-iex> delete_project(project)
-{:error, %Ecto.Changeset{}}
+iex> delete_project(project)
+{:error, %Ecto.Changeset{}}
@@ -642,8 +642,8 @@ export_project(atom, project_id)
Examples
-iex> export_project(:yaml, project_id)
-{:ok, string}
+iex> export_project(:yaml, project_id)
+{:ok, string}
@@ -693,10 +693,10 @@ get_project!(id)
Examples
-iex> get_project!(123)
-%Project{}
+iex> get_project!(123)
+%Project{}
-iex> get_project!(456)
+iex> get_project!(456)
** (Ecto.NoResultsError)
@@ -791,10 +791,10 @@ get_project_user!(id)
Examples
-iex> get_project_user!(123)
-%ProjectUser{}
+iex> get_project_user!(123)
+%ProjectUser{}
-iex> get_project_user!(456)
+iex> get_project_user!(456)
** (Ecto.NoResultsError)
@@ -824,16 +824,16 @@ get_project_user_role(user, project)
Examples
-iex> get_project_user_role(user, project)
+iex> get_project_user_role(user, project)
:admin
-iex> get_project_user_role(user, project)
+iex> get_project_user_role(user, project)
:viewer
-iex> get_project_user_role(user, project)
+iex> get_project_user_role(user, project)
:editor
-iex> get_project_user_role(user, project)
+iex> get_project_user_role(user, project)
:owner
@@ -862,10 +862,10 @@ get_project_with_users!(id)
Examples
-iex> get_project!(123)
-%Project{}
+iex> get_project!(123)
+%Project{}
-iex> get_project!(456)
+iex> get_project!(456)
** (Ecto.NoResultsError)
@@ -976,8 +976,8 @@ list_projects()
Examples
-iex> list_projects()
-[%Project{}, ...]
+iex> list_projects()
+[%Project{}, ...]
@@ -1435,11 +1435,11 @@ update_project(project, attrs)
Examples
-iex> update_project(project, %{field: new_value})
-{:ok, %Project{}}
+iex> update_project(project, %{field: new_value})
+{:ok, %Project{}}
-iex> update_project(project, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_project(project, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -1467,11 +1467,11 @@ update_project_user(project_user, attrs)
Examples
-iex> update_project_user(project_user, %{field: new_value})
-{:ok, %ProjectUser{}}
+iex> update_project_user(project_user, %{field: new_value})
+{:ok, %ProjectUser{}}
-iex> update_project_user(projectUser, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_project_user(projectUser, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -1521,8 +1521,8 @@ validate_for_deletion(project, attrs)
Examples
-iex> validate_for_deletion(project)
-%Ecto.Changeset{data: %Project{}}
+iex> validate_for_deletion(project)
+%Ecto.Changeset{data: %Project{}}
diff --git a/Lightning.Runtime.LogAgent.html b/Lightning.Runtime.LogAgent.html
index 68d0563e66..cbdaf9b280 100644
--- a/Lightning.Runtime.LogAgent.html
+++ b/Lightning.Runtime.LogAgent.html
@@ -115,9 +115,9 @@
Agent facility to consume STDOUT/STDERR byte by byte.
Since it works on a byte by byte basis, you will need to perform line-splitting
-yourself.
Usage:
{:ok, log} = LogAgent.start_link()
-"foo" = LogAgent.process_chunk(log, {:stdout, "foo"})
-"foobar" = LogAgent.process_chunk(log, {:stdout, "bar"})
+yourself.Usage:
{:ok, log} = LogAgent.start_link()
+"foo" = LogAgent.process_chunk(log, {:stdout, "foo"})
+"foobar" = LogAgent.process_chunk(log, {:stdout, "bar"})
diff --git a/Lightning.Scrubber.html b/Lightning.Scrubber.html
index 98e161768b..52b35eb968 100644
--- a/Lightning.Scrubber.html
+++ b/Lightning.Scrubber.html
@@ -114,11 +114,11 @@
-Process used to scrub strings of sensitive information.
Can be started via start_link/1
.
{:ok, scrubber} =
- Lightning.Scrubber.start_link(
+Process used to scrub strings of sensitive information.
Can be started via start_link/1
.
{:ok, scrubber} =
+ Lightning.Scrubber.start_link(
samples:
- Lightning.Credentials.sensitive_values_for(credential)
- )
Takes an optional :name
key, in case you need to name the process.
+ Lightning.Credentials.sensitive_values_for(credential)
+ )
Takes an optional :name
key, in case you need to name the process.
diff --git a/Lightning.TaskWorker.html b/Lightning.TaskWorker.html
index 495dd0cc29..486ea4bc38 100644
--- a/Lightning.TaskWorker.html
+++ b/Lightning.TaskWorker.html
@@ -117,7 +117,7 @@
A TaskWorker with concurrency limits.
A simple concurrency limiter that wraps Task.Supervisor
, which already does
have the ability to specify max_children
; it throws an error when
that limit is exceeded.
To use it, start it like any other process; ideally in your supervision tree.
...,
- {Lightning.TaskWorker, name: :cli_task_worker, max_tasks: 4}
Options
:max_tasks
Defaults to the number of system schedulers available to the vm.
+ {Lightning.TaskWorker, name: :cli_task_worker, max_tasks: 4}
Options
:max_tasks
Defaults to the number of system schedulers available to the vm.
diff --git a/Lightning.Validators.html b/Lightning.Validators.html
index 2052844738..d8bcd9b0e1 100644
--- a/Lightning.Validators.html
+++ b/Lightning.Validators.html
@@ -192,10 +192,10 @@ validate_exclusive(changeset, fields, messa
Validate that only one of the fields is set at a time.
Example:
changeset
-|> validate_exclusive(
- [:source_job_id, :source_trigger_id],
+|> validate_exclusive(
+ [:source_job_id, :source_trigger_id],
"source_job_id and source_trigger_id are mutually exclusive"
-)
+)
diff --git a/Lightning.WorkOrderService.html b/Lightning.WorkOrderService.html
index e3262acddc..e0bfbd61cb 100644
--- a/Lightning.WorkOrderService.html
+++ b/Lightning.WorkOrderService.html
@@ -342,11 +342,11 @@ create_work_order(attrs \\ %{})
Examples
-iex> create_work_order(%{field: value})
-{:ok, %WorkOrder{}}
+iex> create_work_order(%{field: value})
+{:ok, %WorkOrder{}}
-iex> create_work_order(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_work_order(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.Workflows.html b/Lightning.Workflows.html
index f3ff3e520c..1119e4f357 100644
--- a/Lightning.Workflows.html
+++ b/Lightning.Workflows.html
@@ -349,8 +349,8 @@ change_workflow(workflow, attrs \\ %{})
Examples
-iex> change_workflow(workflow)
-%Ecto.Changeset{data: %Workflow{}}
+iex> change_workflow(workflow)
+%Ecto.Changeset{data: %Workflow{}}
@@ -402,11 +402,11 @@ create_workflow(attrs \\ %{})
Examples
-iex> create_workflow(%{field: value})
-{:ok, %Workflow{}}
+iex> create_workflow(%{field: value})
+{:ok, %Workflow{}}
-iex> create_workflow(%{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> create_workflow(%{field: bad_value})
+{:error, %Ecto.Changeset{}}
@@ -434,11 +434,11 @@ delete_workflow(workflow)
Examples
-iex> delete_workflow(workflow)
-{:ok, %Workflow{}}
+iex> delete_workflow(workflow)
+{:ok, %Workflow{}}
-iex> delete_workflow(workflow)
-{:error, %Ecto.Changeset{}}
+iex> delete_workflow(workflow)
+{:error, %Ecto.Changeset{}}
@@ -539,10 +539,10 @@ get_workflow!(id)
Examples
-iex> get_workflow!(123)
-%Workflow{}
+iex> get_workflow!(123)
+%Workflow{}
-iex> get_workflow!(456)
+iex> get_workflow!(456)
** (Ecto.NoResultsError)
@@ -623,8 +623,8 @@ list_workflows()
Examples
-iex> list_workflows()
-[%Workflow{}, ...]
+iex> list_workflows()
+[%Workflow{}, ...]
@@ -654,8 +654,8 @@ mark_for_deletion(workflow, attrs \\ %{})
Examples
-iex> change_request_deletion(workflow)
-%Ecto.Changeset{data: %Workflow{}}
+iex> change_request_deletion(workflow)
+%Ecto.Changeset{data: %Workflow{}}
@@ -733,11 +733,11 @@ update_workflow(workflow, attrs)
Examples
-iex> update_workflow(workflow, %{field: new_value})
-{:ok, %Workflow{}}
+iex> update_workflow(workflow, %{field: new_value})
+{:ok, %Workflow{}}
-iex> update_workflow(workflow, %{field: bad_value})
-{:error, %Ecto.Changeset{}}
+iex> update_workflow(workflow, %{field: bad_value})
+{:error, %Ecto.Changeset{}}
diff --git a/Lightning.epub b/Lightning.epub
index 1b84c32767..2a36e67e9e 100644
Binary files a/Lightning.epub and b/Lightning.epub differ
diff --git a/LightningWeb.Gettext.html b/LightningWeb.Gettext.html
index 9f0fa02711..38248080a0 100644
--- a/LightningWeb.Gettext.html
+++ b/LightningWeb.Gettext.html
@@ -118,15 +118,15 @@
your module gains a set of macros for translations, for example:import LightningWeb.Gettext
# Simple translation
-gettext("Here is the string to translate")
+gettext("Here is the string to translate")
# Plural translation
-ngettext("Here is the string to translate",
+ngettext("Here is the string to translate",
"Here are the strings to translate",
- 3)
+ 3)
# Domain-based translation
-dgettext("errors", "Here is the error message to translate")
See the Gettext Docs for detailed usage.
+dgettext("errors", "Here is the error message to translate")
See the Gettext Docs for detailed usage.
diff --git a/LightningWeb.OauthCredentialHelper.html b/LightningWeb.OauthCredentialHelper.html
index 86520d8f4b..c0babfaccf 100644
--- a/LightningWeb.OauthCredentialHelper.html
+++ b/LightningWeb.OauthCredentialHelper.html
@@ -240,10 +240,10 @@ broadcast_forward(subscription_id, mod, opt
Broadcast a message specifically for forwarding a message to a component.
It expects a subscription_id
, the module of the component and opts
being a keyword list containing an :id
key of the specific component.
See: Phoenix.LiveView.send_update/3
for more info.
A corresponding LiveView (that is subscribed) is expected to have a matching
-handle_info/2
that looks like this:
def handle_info({:forward, mod, opts}, socket) do
- send_update(mod, opts)
- {:noreply, socket}
-end
+handle_info/2
that looks like this:def handle_info({:forward, mod, opts}, socket) do
+ send_update(mod, opts)
+ {:noreply, socket}
+end
diff --git a/LightningWeb.Pagination.html b/LightningWeb.Pagination.html
index 439d9d57bd..5f44eca114 100644
--- a/LightningWeb.Pagination.html
+++ b/LightningWeb.Pagination.html
@@ -243,13 +243,13 @@ raw_pagination_links(paginator, options \\
Returns the raw data in order to generate the proper HTML for pagination links. Data
is returned in a {text, page_number}
format where text
is intended to be the text
of the link and page_number
is the page it should go to. Defaults are already supplied
-and they are as follows:
[distance: 5, next: :next, previous: :previous, first: true, last: true, ellipsis: :ellipsis]
distance
must be a positive non-zero integer or an exception is raised. next
and previous
should be
+and they are as follows:
[distance: 5, next: :next, previous: :previous, first: true, last: true, ellipsis: :ellipsis]
distance
must be a positive non-zero integer or an exception is raised. next
and previous
should be
strings but can be anything you want as long as it is truthy, falsey values will remove
them from the output. first
and last
are only booleans, and they just include/remove
-their respective link from output. An example of the data returned:
iex> Scrivener.HTML.raw_pagination_links(%{total_pages: 10, page_number: 5})
-[{"<<", 4}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, {8, 8}, {9, 9}, {10, 10}, {">>", 6}]
-iex> Scrivener.HTML.raw_pagination_links(%{total_pages: 20, page_number: 10}, first: ["←"], last: ["→"])
-[{"<<", 9}, {["←"], 1}, {:ellipsis, {:safe, "…"}}, {5, 5}, {6, 6},{7, 7}, {8, 8}, {9, 9}, {10, 10}, {11, 11}, {12, 12}, {13, 13}, {14, 14},{15, 15}, {:ellipsis, {:safe, "…"}}, {["→"], 20}, {">>", 11}]
Simply loop and pattern match over each item and transform it to your custom HTML.
+their respective link from output. An example of the data returned:iex> Scrivener.HTML.raw_pagination_links(%{total_pages: 10, page_number: 5})
+[{"<<", 4}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, {8, 8}, {9, 9}, {10, 10}, {">>", 6}]
+iex> Scrivener.HTML.raw_pagination_links(%{total_pages: 20, page_number: 10}, first: ["←"], last: ["→"])
+[{"<<", 9}, {["←"], 1}, {:ellipsis, {:safe, "…"}}, {5, 5}, {6, 6},{7, 7}, {8, 8}, {9, 9}, {10, 10}, {11, 11}, {12, 12}, {13, 13}, {14, 14},{15, 15}, {:ellipsis, {:safe, "…"}}, {["→"], 20}, {">>", 11}]
Simply loop and pattern match over each item and transform it to your custom HTML.
diff --git a/Mix.Tasks.Lightning.InstallSchemas.html b/Mix.Tasks.Lightning.InstallSchemas.html
index 17fa06e81c..e6b9339055 100644
--- a/Mix.Tasks.Lightning.InstallSchemas.html
+++ b/Mix.Tasks.Lightning.InstallSchemas.html
@@ -1797,14 +1797,14 @@ request(request)
Examples
-request = %HTTPoison.Request{
+request = %HTTPoison.Request{
method: :post,
url: "https://my.website.com",
body: "{\"foo\": 3}",
- headers: [{"Accept", "application/json"}]
-}
+ headers: [{"Accept", "application/json"}]
+}
-request(request)
+request(request)
@@ -1862,7 +1862,7 @@ request(method, url, body \\ "",
Examples
-request(:post, "https://my.website.com", "{\"foo\": 3}", [{"Accept", "application/json"}])
+request(:post, "https://my.website.com", "{\"foo\": 3}", [{"Accept", "application/json"}])
diff --git a/readme.html b/readme.html
index fa8e2b32cd..7611602d45 100644
--- a/readme.html
+++ b/readme.html
@@ -335,7 +335,7 @@
Problems with Debian
If you're getting this error on debian
==> earmark_parser
-Compiling 1 file (.yrl)
+Compiling 1 file (.yrl)
/usr/lib/erlang/lib/parsetools-2.3.1/include/yeccpre.hrl: no such file or directory
could not compile dependency :earmark_parser, "mix compile" failed. You can recompile this dependency with "mix deps.compile earmark_parser", update it with "mix deps.update earmark_parser" or clean it with "mix deps.clean earmark_parser"
You need to install erlang development environment sudo apt install erlang-dev
refer to this issue
@@ -361,8 +361,8 @@ Versions
The build may not work on old versions of Docker and Docker
lib/mix/tasks/compile.rambo.ex:89: Mix.Tasks.Compile.Rambo.compile!/0
lib/mix/tasks/compile.rambo.ex:51: Mix.Tasks.Compile.Rambo.run/1
- (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
- (mix 1.14.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2
You can resolve this error by installing the Rust compiler using Homebrew. Run
+
(mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
+ (mix 1.14.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2
You can resolve this error by installing the Rust compiler using Homebrew. Run
the following command in your terminal: brew install rust
If you have already compiled Rambo explicitly via mix compile.rambo
, and you
are still seeing the following error:
sh: /path_to_directory/Lightning/_build/dev/lib/rambo/priv/rambo: No such file or directory
sh: line 0: exec: /path_to_directory/Lightning/_build/dev/lib/rambo/priv/rambo: cannot execute: No such file or directory
You can try renaming deps/rambo/priv/rambo-mac
to deps/rambo/priv/rambo
.
If neither of the approaches above work, please raise an issue.
Starting from scratch
If you're actively working with docker, you start experiencing issues, and you