Commit graph

180 commits

Author SHA1 Message Date
Zach Daniel
a5074d9d2f chore: update ex_doc 2024-04-10 10:01:57 -04:00
2973c0db94 improvement(Ash.Reactor): Allow create to be provided an initial value.
The initial value can be either a resource or a changeset.
2024-04-09 09:03:04 +12:00
Zach Daniel
ec76778b49 chore: backport fixes from 2.0 2024-04-04 14:45:03 -04:00
Zach Daniel
f8384e44b5 improvement: add skip_unknown_inputs option, use it for embeds in unions 2024-03-28 16:29:37 -04:00
Zach Daniel
5967ed3a48 improvement!: 3.0 (#955)
* improvement!: use `%Ash.NotSelected{}` for unselected values

* improvement!: default `require_atomic?` to `true`

* improvement!: raise errors on unknown generic action arguments

* improvement!: default bulk strategy to `:atomic`

* improvement!: warnings on `require_atomic?` `true` actions
improvement!: revise `Ash.NotSelected` to `Ash.NotLoaded`
improvement!: errors on unknown action inputs across the board

* doc: clarify wording in notifiers.md

closes #889

* improvement!: default `api.authorization.authorize` to `:by_default`

* improvement!: require the api when constructing changesets

this commit also fixes some work from prior commits around
the default value for the `authorize` option

* improvement!: code_interface.define_for -> code_interface.api

`code_interface.define_for` is now `code_interface.api`. Additionally, it is set automatically if the `api` option is specified on `use Ash.Resource`.

* improvement!: remove registries

* improvement!: pubsub notifier default to `previous_values?: false`
improvement!: requires_original_data? callback defaults to false

* improvement!: rename Ash.Calculation -> Ash.Resource.Calculation
improvement!: improve `Ash.Query.Calculation.new` signature
improvement!: anonymous function calculations now take lists and return lists
improvement!: make callback contexts into structs
improvement!: pass context to builtin lifecycle hook changes
improvement!: calculation arguments are now in the `arguments` key of the context

* chore: fix build

* improvement!: remove `aggregates` and `calculations` from `Filter.parse` and `Filter.parse_input`

* improvement: update spark to 2.0

* improvement!: make picosat_elixir optional with `simple_sat`

* improvement!: rename api to domain

* docs: add more info to upgrading guide

* docs: tweak docs formatting

* improvement!: remove `Ash.Changeset.new!`

* docs: update docs for `Ash.Changeset.new/1`

* improvement!: deprecate `private?: false` in favor of `public?: true`

* doc: add upgrade guide for private -> public

* improvement: update reactor to 3.0

* improvement!: default `default_accept` is now `[]`

* improvement!: `Ash.CiString.new/1` returns `nil` on `nil` input

* improvement!(Ash.Reactor): Improve integration with Ash 3.0 changes.

* improvement!: clean up and reorganize `Ash` functions

this is in preparation of deprecating the functions that are defined
on the api

improvement!: remove context-based functionality

* chore: update docs references from `Ash.Domain` to `Ash`

* chore: fix bad merge

* chore: fix context access in atomic changes

* improvement!: Deprecate calling functions on (domain) api in favor of `Ash`

* improvement!: add `attribute_public?` and update `attribute_writable?` behavior

* improvement!: update atomic behaviors, default to invalid

* chore: update downcase docs

* improvement!: changeset.filters -> changeset.filter

* improvement!: remove deprecated functions

* improvement!: remove and simplify `Ash.Filter.TemplateHelpers`

* improvement: import Ash.Expr in modules where it is used
improvement: require Ash.QUery in modules where it makes sense

* fix!: keyword lists are no longer special cased in ash expressions

* improvement: add structs for more context implementations

* chore: small tweaks, finish `:all` -> `:*` conversion

* chore: update DSL docs for multitenancy.global?

* improvement: ensure selects are applied on destroys
chore: remove TODOs

* chore: some docs changes

* improvement!: introduce strict mode to calculations

* chore: update tests

* improvement: support custom expressions

* docs: document custom expressions

* chore: fix and test custom expressions and function fragments
docs: update relevant docs w/ the changes

* improvement!: reverse order of before action & before transaction hooks

* improvement!: default read actions are now paginatable

* improvement!: require explicit accept lists in default actions

* chore: update docs

* improvement!: remove Ash.Flow and Ash.Engine

* chore: unlock unused deps

* chore: don't use unused variable

* chore: include ash flow change in upgrade guide

* improvement!: standardize various exception keys and names

* improvement!: use `Splode` for errors

* improvement: update upgrade guide to include Splode

* feat: code interface on the domain

* improvement: only require primary key if resource has actions or fields
improvement: only build schema if resource has actions or fields
improvement: verify primary key in its own verifier

* improvement: add `resource/1` builtin check

* improvement!: move simple_notifiers to an option instead of a DSL builder
improvement!: update spark for better autocomplete, configure autocomplete for key functions
docs: replace `an domain` with `a domain`

* improvement: better code interface documentation

* fix: set tenant on query so that root calles to Api.aggreagte work as expected (#929)

* chore: fixes from previous improvements

* chore: update splode

* chore: update splode

* improvement!: swap position of sort order and arguments in calculation sorting

* improvement!: add `include_nil?` aggregate option, and default it to `false`

* improvement: support notifiers within actions

* improvement: support specifying multiple filters

* improvement: add `sortable?` flags to all fields
improvement: support multiple filters on relationships

* improvement: support sensitive? on calculations and arguments

* improvement: validate resources in inputs to code interface

* chore: don't require explicit accept lists when using `default_accept :*`

* chore: update spark

* chore: update public attribute handling per 3.0

* improvement: update reactor and tests

* chore: better error message

* chore: fix rebase issue

* chore: handle merge issues
improvement: don't require domain on relationships if destination has domain

* improvement!: errors on unknown inputs for calculations

* improvement: always choose to cast atomic

* improvement: support casting some embeds atomically

* improvement: various 3.0 updates, documented in upgrade.md

* chore: Add failing tests for loads with with explicit domains. (#948)

Co-authored-by: James Harton <james@harton.nz>

* improvement: ensure non-static dynamic domains works

* improvement: add Ash.ToTenant protocol

* chore: add docs for no ToTenant option

* fix: properly construct new query in `build/3`

* chore: update simple_sat dependency

* chore: don't reselect when missing primary keys

* chore: remove IO.inspect

* chore: update spark

* chore: update spark

* improvement: use `Keyword.put_new` in `Ash.Context.to_opts` (#953)

* improvement: support bulk and atomic operations in code interfaces

---------

Co-authored-by: James Harton <james@harton.nz>
Co-authored-by: WIGGLES <55168935+WIGGLES-dev@users.noreply.github.com>
Co-authored-by: Dmitry Maganov <vonagam@gmail.com>
2024-03-27 16:31:59 -04:00
86d74ed789
feat(Ash.Reactor): Add a Reactor extension that makes working with resources easy. (#683)
* feat: Add `Ash.Reactor` with create support.

* improvement: Add `Ash.Reactor` update support.

* improvement: Add `Ash.Reactor` destroy support.

* improvement(Ash.Reactor): Support for transactional handling of notifications.

* improvement(Ash.Reactor): Add `read` and `get` steps.

* docs: Add the beginnings of a Reactor topic.

* improvement(Ash.Reactor): add support for generic actions.

* improvement: Add `undo` capability to `create` step.

* improvement: transaction and undo working.

* docs: Start documenting undo behaviour.

* chore: Update to Reactor 0.6.

* improvement: Automatically thread Ash tracers through Reactor.

* improvement(Ash.Reactor): Add undo to generic actions.

* docs: Improve reactor documentation.

* fix: Mimic copying `Ash.Notifier` seems to break the compiler for some reason.
2024-03-02 10:26:25 +13:00
Zach Daniel
944f69b16e fix: properly annotate run_flow's recursive DSL tag
docs: update spark & docs
2024-02-16 21:25:18 -05:00
Zach Daniel
d013818c0a improvement: handle pkey-less resources when attaching fields
improvement: set lazy defaults when applying changeset attributes
2024-01-21 00:45:35 -05:00
Zach Daniel
3db822d775 improvement: optimize embedded resource creation 2024-01-19 09:58:54 -05:00
Zach Daniel
072486bebd docs: revamp hexdocs
fix: use current read action for counting
2024-01-12 14:07:35 -05:00
Zach Daniel
63c15bbfe9 improvement: error on using relate_actor with :many cardinality relationships 2024-01-10 05:56:22 -05:00
Zach Daniel
3be83d6ca4 improvement: lay the groundwork for fully atomic actions 2023-12-16 10:14:02 -05:00
Zach Daniel
14db149473 chore: update spark 2023-12-12 20:38:51 -05:00
Zach Daniel
e680867be9 fix: don't reorder global validations/changes
fix: use latest spark, and new persisters callback
fix: properly validate belongs_to relationships
2023-10-25 17:45:55 -04:00
Zach Daniel
7f7469eb9f improvement: various performance improvements 2023-10-17 01:08:26 -04:00
Zach Daniel
969ebf7f3f docs: update spark to fix docs 2023-10-11 09:30:22 -04:00
Zach Daniel
1042ea14fd chore: use uuids instead of unique integer for performance reasons 2023-10-03 13:42:18 -04:00
Zach Daniel
5c8f96231e docs: finalize initial cheat_sheet/docs pattern 2023-09-26 23:13:40 -04:00
Zach Daniel
55f15c8427 chore: update ex_doc 2023-09-21 18:52:11 -04:00
Zach Daniel
0a1f56d58b chore: update cheat_sheets 2023-09-20 16:29:47 -04:00
Zach Daniel
17b1a0b2df fix: properly wrap [tracer] in Ash.Flow 2023-09-20 13:31:58 -04:00
Zach Daniel
4764094145 docs: improve doc cheat sheets 2023-09-15 12:16:54 -04:00
Zach Daniel
b9488dbbcb chore: release version v2.14.17 2023-09-15 11:41:41 -04:00
Zach Daniel
ab52855600 improvement: recommit the dsl cheatsheets, and update ash-ci 2023-09-14 17:16:35 -04:00
Zach Daniel
6e2d1fd0ac docs: greatly improved DSL documentation in hex 2023-09-13 22:17:18 -04:00
Zach Daniel
c0d8a86987 improvement: support resources directly in API modules
improvement: compile time warning on resources not detected in any apis
2023-07-13 01:38:21 -04:00
Zach Daniel
0b6d93c7c4 feat: add field_policies
see included documentation for more information on how field policies
work.
2023-06-22 14:00:11 -04:00
Barnabas Jovanovics
b5e0cbb3cc
improvement: add constraints to maps (#556) 2023-04-07 09:53:41 -04:00
Zach Daniel
7f1ee67dde improvement: update spark to fix deeply nested DSLs 2023-03-31 11:54:44 -04:00
Zach Daniel
b425b243f5 improvement: update spark for latest doc improvements 2023-02-05 18:08:01 -05:00
Zach Daniel
a2a04f66af chore: clean up unused dependencies from lockfile 2023-02-01 01:01:23 -05:00
Zach Daniel
e900d00de8 ci: remove tweets/switch to standardized CI pipeline 2023-01-31 11:15:09 -05:00
Zach Daniel
306ecd01e4 chore: update to latest spark 2023-01-27 15:50:47 -05:00
Zach Daniel
167dba67ca improvement: upgrade to latest spark for compile time improvements
improvement: improve compile times by reorienting some compile deps
2023-01-27 15:32:28 -05:00
Zach Daniel
5006e79593 chore: release version v2.5.4 2023-01-18 00:41:08 -05:00
Zach Daniel
b2fb3b4254 chore: release version v2.5.0 2023-01-10 21:52:36 -05:00
Zach Daniel
f9ed91953b fix: import builtins at the action level, not the section level 2022-12-22 19:09:47 -05:00
Zach Daniel
41fc04dd85 improvement: update spark 2022-12-15 03:57:59 -05:00
Zach Daniel
b1bbd979d4 fix: don't lock specific nimble options version 2022-12-07 16:50:56 -05:00
Zach Daniel
a6ca9511c7 fix: set proper types in transaction reasons 2022-12-01 12:06:51 -05:00
Zach Daniel
a2fc21a218 chore: fix dialyzer 2022-11-15 21:39:57 -05:00
Zach Daniel
d8ae4da1b3 docs: use new spark doc index guide order 2022-11-15 14:47:25 -05:00
Zach Daniel
665a9fb5c4 improvement: optimize sat solving
1. only convert to CNF once
2. group predicates that only appear in specific combinations to limit amount of variables provided to the sat solver

Number 2 above does technically slow down all cases a bit, but the optimization is really important when it matters. And cases that don't need this optimization still happen on the order microseconds anyway.
2022-11-15 01:45:55 -05:00
Zach Daniel
1dcb9dd8c4 docs: library links 2022-11-03 08:19:35 -07:00
Zach Daniel
a0e5b2cb7d docs: small docs tweaks
improvement: update to latest spark
2022-11-03 00:47:24 -07:00
Zach Daniel
85e121bcd7 chore: update to latest spark 2022-10-30 22:11:56 -04:00
Zach Daniel
8cbd766172 feat: support anonymous functions in DSL
improvement: add more ergonomic manual action definitions.

The old method will likely be deprecated some time in the future (there is no rush really, they both work).
2022-10-30 21:00:57 -04:00
Zach Daniel
1718314f40 chore: update spark 2022-10-28 10:34:43 -05:00
Zach Daniel
e52d7187d8 improvement: more additions to the resource builder, update spark
test: add a test for loading many to many relationships on code interface actions
2022-10-28 10:18:01 -05:00
James Harton
2d6762ae61
feat(Ash.PlugHelpers): standardise conn interface for actors/tenants. (#432) 2022-10-27 17:52:42 -05:00
Zach Daniel
6b9cff5d43 feat: add Ash.Resource.Builder, the start of DSL builder utilities of rextension writing 2022-10-24 12:04:56 -06:00
Zach Daniel
986e08e0c2 fix: properly compare against decimal values
improvement: support floats & decimals in the `compare` validation
2022-10-21 10:46:46 -04:00
Zach Daniel
e9ca762e34 improvement: update to latest spark
chore: clean up tests & remove warnings
2022-10-08 14:00:08 -04:00
Zach Daniel
b20c4afd9b improvement: haltable flows, branch step type
fix: fix chart links rendering
2022-10-06 17:04:44 -04:00
Zach Daniel
0efad5ae4e improvement: various Ash.Flow improvements, including returning the new Ash.Flow.Result 2022-10-04 16:21:38 -04:00
Zach Daniel
bef54aaba9 chore: update git_ops 2022-10-04 02:03:49 -04:00
Zach Daniel
6f14cf0263 docs: add mix_tasks to doc_index 2022-09-28 20:59:47 -04:00
Zach Daniel
3903e36d29 improvement: update to latest spark, support dsls in resource info 2022-09-20 16:09:40 -04:00
Zach Daniel
5c81d2b4a7 fix: properly do pagination
docs: fix some docs, add some guides
2022-09-11 22:19:37 -04:00
Zach Daniel
1bb3468851 improvement: add tracing and telemetry 2022-08-28 19:27:44 -06:00
Zach Daniel
2e6ec5b8b4 docs: total docs reorg 2022-08-28 19:27:44 -06:00
Zach Daniel
603f845952 chore: update spark 2022-08-28 19:27:44 -06:00
Zach Daniel
d7a9ff7996 improvement: move docs out of priv, update spark 2022-08-28 19:27:44 -06:00
Zach Daniel
1d3b26d1c7 WIP on docs 2022-08-28 19:27:44 -06:00
Zach Daniel
6d98b78227 improvement: unlock flow
improvement: pagination as a DSL
improvement: don't block engine on async tasks
2022-08-28 19:27:44 -06:00
Zach Daniel
f9941a6c75 improvement: update spark, use new transformer style 2022-08-28 19:27:44 -06:00
Zach Daniel
04744f395f improvement: move functions to more conventional places
improvement: move ash.formatter task to `spark.formatter`
2022-08-28 19:27:44 -06:00
Zach Daniel
44adc9a1b8 improvement: upgrade spark, move to its formatter 2022-08-28 19:27:44 -06:00
Zach Daniel
a5f616812b improvement: replace Ash DSL underpinnings with Spark 2022-08-28 19:27:44 -06:00
Mike Buhot
150f7178b8
improvement: Replace usage of Timex.shift with builtin Calendar functions (#362) 2022-08-17 19:18:03 -04:00
Zach Daniel
ef3d1ea398 improvement: Ash.Generator 2022-06-21 21:00:47 -04:00
Zach Daniel
3fc088d1fc fix: properly handle errors in mnesia transactions
improvement: work on transaction flow steps
2022-04-20 14:38:35 -04:00
Josh Price
5c579797cf
chore: Update sourceror to 0.11.1 (#314) 2022-04-19 12:09:40 -04:00
Josh Price
00234bd520
chore: Update Credo to 1.6.4 (#315)
See https://github.com/rrrene/credo/blob/master/CHANGELOG.md

Mostly bug fixes since 1.6.1
2022-04-19 12:09:19 -04:00
Josh Price
4fde1b9d93
chore: Update Ecto to 3.7.2 (#316)
Co-authored-by: Zach Daniel <zach@zachdaniel.dev>
2022-04-19 11:33:37 -04:00
Josh Price
abfba644ec
chore: Update dev dependencies (#317) 2022-04-19 10:25:34 -04:00
Zach Daniel
7dc5e54af0 improvement: add descriptions to mermaid charts/flow 2022-04-18 13:39:54 -04:00
Zach Daniel
4e19223173 improvement: tons of engine/timeout improvements 2022-04-17 23:56:01 -04:00
Zach Daniel
350122d116 improvement: remove coverage from CI 2022-04-06 14:22:53 -04:00
Zach Daniel
4138bd4934 improvement: initial implementation of ash resource formatter 2022-02-02 17:02:43 -05:00
Zach Daniel
101628471e improvement: support data layers bulk adding aggregates 2022-01-12 13:47:01 -05:00
Zach Daniel
6c5198eea4
improvement: add elixir_sense extension, to be merged when ready (#275) 2021-12-13 18:17:34 -05:00
Zach Daniel
05b279a029 improvement: use paramaterized types under the hood
improvement!: update ecto version
fix: pass constraints to sub-fields loaded in embeddable resources
2021-09-13 11:46:11 -04:00
Zach Daniel
aab12bc597 fix: update to latest picosat_elixir for releases 2021-08-29 12:36:16 -04:00
Zach Daniel
0d20de1a3a chore: update git_ops 2021-06-24 14:45:20 -04:00
Zach Daniel
d560b81eae chore: upgrade git_ops 2021-06-04 14:59:22 -04:00
Vitor Oliveira
b472496277
Update dependencies (#239) 2021-05-22 03:41:41 -04:00
Vitor Oliveira
aaafdf130e
Update elixir_make to 0.6.2 (#238) 2021-05-22 02:25:44 -04:00
Jason Axelson
3ba6b593b1
docs: Updates to the docs with a focus on the getting started docs (#195) 2021-03-14 17:14:53 -04:00
Zach Daniel
f6f5d194bf feat: freeform expressions
feat: validatiosn in actions

feat: query arguments

feat: add `Ash.Query.for_read/3`

feat: return changeset with API errors

feat: add case insensitive string `CiString`/`:ci_string`

feat: support `context/1` and `arg/1` in filter templates

feat: support targeting notifications with the `for` option

feat: add `ago/2` query function

feat: add basic arithmetic operators (+, *, -, /)

feat: `sensitive?` option for attributes

feat: `sensitive?` option for arguments

feat: `private` arguments, which can’t be set using `for_<action>`

feat: add `prevent_change` which will erase changes just before the changeset is committed

feat: add `match?` validation that supports a custom error message

feat: add `interval` type to support `ago/2` function

feat: add `url_encoded_binary` type

feat: add `function` type

improvement: `changing?` is now a validation

improvement: add `Transformer.get_persisted/3`

improvement: add `api` field to `Notification`

improvement: standardize errors, add `to_error_class`

improvement: use `Comp` everywhere

Improvement: use action on changeset if set by `for_<action_type>`

improvement: `action_failed?` field on change sets

improvement: remove ability for data layers to add operators (for now at least)

Improvement: Changeset.apply_attributes/2 now returns an error tuple

Improvement: add a bunch of new/informative errors

improvement: runtime filter now uses left join logic (a naive implementation of it)

improvement: support more filter templates in resources

Improvement: basic/naive type system for operators/functions

Fix: properly expand module aliases for options w/o compile time dependency

chore(engine): track changeset changes for the request with `manage_changeset?: true`
2021-01-21 15:22:50 -05:00
Zach Daniel
9fbce8e198 chore: fix git diff in mix.lock 2021-01-09 11:57:39 -05:00
Zach Daniel
b6b16fe789 chore: update decimal dependency 2021-01-09 11:48:03 -05:00
Zach Daniel
9abdcc62c1 chore: update git_ops 2021-01-08 15:27:39 -05:00
Zach Daniel
9a9745be24 chore: update git_ops 2021-01-08 12:48:58 -05:00
Zach Daniel
c6ea07896b test: various testing improvements 2020-12-01 00:51:24 -05:00
Zach Daniel
ae5ff031a0
chore: remove unused deps 2020-09-28 12:36:43 -04:00
Zach Daniel
9fc3c569ca
chore: update mix.lock 2020-09-21 18:38:16 -04:00
Zach Daniel
0f34797ee2
fix: upgrade picosat dependency 2020-09-21 18:33:45 -04:00
Mike Binns
846f381d08
ci: Improve CI Elixir/Erlang matrix (#96) 2020-08-25 15:39:40 -04:00
Mike Binns
223e88f3f2
chore: Update sobelow and ex_check to clear up ci warnings (#95) 2020-08-20 21:28:25 -04:00