Frank Dugan III
e691222af0
fix: destroy action types default to accepts [] ( #453 )
2022-11-18 18:40:56 -05:00
Zach Daniel
c8d08a3265
fix: handle tuples properly in some cases in expression syntax
2022-11-16 12:00:43 -05:00
Kyle Grinstead
c0efa2ae1f
chore: add failing test for invalid syntax error ( #444 )
2022-11-16 11:47:43 -05:00
Zach Daniel
27ca1d2f3c
fix: properly raise error on invalid type.
...
closes #422
2022-11-03 16:06:26 -07:00
Zach Daniel
cb192517c7
fix: allow references on both sides of in
2022-10-31 12:08:24 -04:00
Zach Daniel
6994295a8f
fix: properly upsert all explicitly changed fields
...
fix: traverse maps for `template_references_actor?/1`
docs: various doc fixes
2022-10-31 11:33:51 -04:00
Zach Daniel
113d2452d2
improvement: replace templates in change/preparation/validation opts
...
Previously, only a few specific changes supported using `arg/1` or `context/1`
in their options. Now, those templates can be used in any change options,
built-in or not.
2022-10-31 02:25:01 -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
Michael St Clair
5626c8be2c
fix: don't add required belongs_to error if changeset is invalid ( #437 )
2022-10-30 17:40:10 -04:00
Zach Daniel
d70a05c805
fix: don't lazy load when managing relationships
...
if a relationship was loaded previously we were just using that relationship value.
However, this has a chance to cause incorrect behavior in edge cases. One such
edge case is illustrated here: https://github.com/ash-project/ash/pull/434 We can return to the
more optimized behavior when lazy loading is improved via https://github.com/ash-project/ash/issues/438
2022-10-30 10:36:26 -04:00
oco-adam
2c85e325cd
test: Add test demonstrating minimal example of strange upsert behaviour ( #434 )
2022-10-29 19:33:19 -04: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
8c0e4de6bd
improvement: allow using get_path/2
by name, as well as bracket access
...
prior to this, you had to say `map[:foo][:bar]`, but now you can also say
`get_path(map, [:foo, :bar])`. This makes certain things much clearer, i.e
`^arg(:foo)[:foo]`, which is problematic, would normally need to be written
as `(^arg(:foo))[:foo]` so that the pin only applied to the `arg/1` call.
This looks much nicer as `get_path(^arg(:foo), [:foo])`.
2022-10-24 07:57:21 -06:00
Zach Daniel
67814a2160
docs: add more context to manual relationship guide
...
docs: add a "Defining Idiomatic Actions" guide
chore: fix flaky tests
2022-10-23 23:08:17 -06:00
Zach Daniel
5e3b71e79b
fix: properly load manual to_one relationships
2022-10-23 22:16:50 -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
d1f05b6c42
fix: don't attempt to re-authorize access to already retrieved records in Api.load/2
...
improvement: show conditions in policy breakdowns
2022-10-20 13:00:23 -04:00
Zach Daniel
235e965627
improvement: sort relationship in order of input when managing it
...
This helps with things like https://github.com/ash-project/ash_phoenix/issues/57
which involve rendering the relationship value after editing it. Retaining
the order allows direct reuse without any gymnastics
2022-10-19 00:39:10 -04:00
Zach Daniel
4ca69be25e
improvement: generate example class/er diagrams
2022-10-18 14:26:42 -05:00
Zach Daniel
4915e5d583
improvement: add now()
to expression syntax
2022-10-18 14:19:28 -05:00
Zach Daniel
8474e60828
chore: more livebook cleanup
2022-10-17 11:04:28 -05:00
Zach Daniel
a365103087
clean up livebook/mermaid diagrams
2022-10-17 10:18:47 -05:00
Josh Price
3f572c65a2
feat: basic livebook generator and mix task ( #420 )
2022-10-17 08:52:24 -05:00
Zach Daniel
1e6be17618
fix: properly lateral join when possible
...
improvement: add `prepend?: true` option to sort
fix: use `prepend?: true` when applying relationship sorts
fix: don't miss dependencies in flow diagrams
improvement: use `simple_equality?/0` to allow for optimized equality checking
2022-10-15 00:03:03 -05:00
Zach Daniel
b0f245b961
chore: update flow pdfs
2022-10-14 01:26:16 -04:00
Josh Price
d1a49276b8
improvement: mermaid mix task for ER diagrams ( #415 )
2022-10-14 01:07:05 -04:00
Zach Daniel
362180190c
fix: properly load calcs/aggs on manual relationships
...
It needs to be optimized, but it will do the trick for now.
2022-10-13 00:36:29 -04:00
Zach Daniel
48d96fc417
fix: properly load nested manual relationships
2022-10-12 21:30:48 -04:00
Zach Daniel
7f07f0d173
improvement: try to resolve flaky tests by not using named tables for private ets resources
2022-10-12 15:26:43 -04:00
Rebecca Le
491c88cacd
fix: allow overriding validation message on a list of errors ( #412 )
2022-10-12 11:44:32 -04:00
Frank Dugan III
62805fcce9
improvement: allow passing query or changeset in can/can?/4 ( #410 )
2022-10-10 11:50:13 -04:00
Zach Daniel
ae8e0e356b
fix: don't show dependencies for run_flow steps in expanded view(they are duplicates)
2022-10-10 01:28:32 -04:00
Nelson Bassett
8378722244
improvement: Improve error when actions reject and accept keys overlap ( #405 )
...
* Test for overlapping action keys, and initial solution.
* Merged ValidateAcceptRejectpOverlap transformer into existing DefaultAccept transformer.
* Corrected formatting using mix format.
2022-10-09 18:05:54 -04:00
Zach Daniel
e9ca762e34
improvement: update to latest spark
...
chore: clean up tests & remove warnings
2022-10-08 14:00:08 -04:00
zimt28
fc4c60b125
improvement: Allow a single where
condition for validations ( #407 )
2022-10-07 11:24:04 -04:00
Zach Daniel
b20c4afd9b
improvement: haltable flows, branch step type
...
fix: fix chart links rendering
2022-10-06 17:04:44 -04:00
Ali Ahmed
0b7db5f3fb
feat: list arguments for resource actions in class diagrams ( #399 )
2022-10-06 02:04:21 -04:00
Zach Daniel
41b4b7fdbb
improvement: simplify async task strategy
...
We now only start tasks once the synchronous work is done as anything
synchronous should be fast, generally.
Additionally, if there is only one task that we are about to start,
we can be confident that all we're going to do is wait for it,
so we can simply run it synchronously
2022-10-06 01:54:44 -04:00
Zach Daniel
c591bf6746
improvement: clean up new create authorization simplification
2022-10-05 20:08:36 -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
George Rodrigues
1f685a1413
docs: fix typos ( #402 )
2022-10-04 16:01:42 -04:00
Zach Daniel
c24d8e6d21
Revert "fix: switch from no_depend_modules in most places"
...
This reverts commit 650d8920e4
.
2022-10-04 11:22:24 -04:00
Zach Daniel
dd6fd1fbc3
improvement: allow select/load callbacks for calcs to return irrelevant keys
...
test: add a test case for nested required calculations
2022-10-04 00:22:40 -04:00
Zach Daniel
650d8920e4
fix: switch from no_depend_modules in most places
2022-10-03 21:47:45 -04:00
Juha
fdebbeb242
improvement: Forbid reserved field names ( #388 )
...
Co-authored-by: Juha Lehtonen <juha.lehtonen@relexsolutions.com>
2022-10-03 16:19:16 -04:00
SpaceEEC
ace38cd31f
improvement: validate accepted and rejected attributes in actions ( #395 )
2022-10-03 12:16:53 -04:00
SpaceEEC
14a1b92963
feat: show_private?
option for diagrams ( #396 )
2022-10-03 11:30:10 -04:00
Josh Price
3d2f8277ad
feat: generate mermaid entity relationship diagrams from a given api ( #376 )
2022-10-01 22:22:00 -04:00
Zach Daniel
95a4aa3708
improvement: optimize for relates_to_actor_via
2022-09-30 15:13:04 -04:00
Zach Daniel
0e13456eb0
improvement: optimize relates_to_actor_via checks
2022-09-28 20:37:19 -04:00
Zach Daniel
b12b5e34bb
fix: properly require a condition of a following bypasses
2022-09-28 16:38:32 -04:00
Zach Daniel
24bdf9058e
improvement: catch more cases in preflight authorization checks
2022-09-27 14:58:48 -04:00
zimt28
33a6438f00
test: Add test for strict_check
with filter policy ( #387 )
2022-09-27 14:43:29 -04:00
Zach Daniel
a8bce0ab23
improvement: lazily set required loads/selects for calcs/sorts
2022-09-26 18:08:18 -04:00
Zach Daniel
3b803d4c55
fix: various fixes with complex policy statements
...
improvement: simplify filter statements further
improvement: don't overconstraint filters on related data
test: get started on some more complex policy tests
2022-09-25 13:21:17 -04:00
Zach Daniel
fbcd745401
improvement: properly mark conditions w/ access_type
...
fix: handle statically false conditions in filter logic
2022-09-22 21:03:33 -04:00
Zach Daniel
1f6fb8d7af
chore: fix tests
2022-09-20 19:44:04 -04:00
Zach Daniel
87f20369bc
improvement: deprecate :replace
in favor of :relate_and_unrelate
2022-09-19 15:44:06 -04:00
Zach Daniel
2ca0f09444
improvement: add loading?/1
query helper
...
improvement: add `loading/1` built in check
2022-09-19 10:14:08 -04:00
Zach Daniel
003ba3246b
fix: add a case for calculations as tuples in expr filters
2022-09-16 03:47:12 -04:00
Zach Daniel
2c2c207e68
fix: use Comp.equal?/2
when finding loaded data matches
2022-09-15 00:55:04 -04:00
Darren Black
865d028667
chore: Guard length function for invalid input ( #380 )
2022-09-15 00:10:01 -04:00
Zach Daniel
a5f51e8f1b
fix: properly error on types when evaluating expressions at runtime
2022-09-14 22:31:32 -04:00
Darren Black
a572099e24
improvement: Implement length function ( #379 )
2022-09-14 13:28:42 -04:00
Zach Daniel
e36f8c3e59
improvement: add filterable?
option to relationships
...
improvement: add data layer capability for aggregate relationships & filter relationships
improvement: add guide on manual relationships
2022-09-13 13:53:05 -04:00
Zach Daniel
dc154596f4
chore: add in commented test
2022-09-12 13:38:00 -04:00
Zach Daniel
f583ababbc
fix: fix keyset pagination ordering bug
...
fix: short names are snake cased
2022-09-12 11:17:44 -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
3644d05cd6
Revert "improvement: make two queries for full keyset pagination support"
...
This reverts commit 64b3312cb9
.
2022-09-11 18:35:02 -04:00
Zach Daniel
64b3312cb9
improvement: make two queries for full keyset pagination support
...
docs: add store context in process guide
2022-09-11 16:07:21 -04:00
Zach Daniel
619adcee93
improvement: add exists/2
expression
2022-09-06 18:02:01 -04:00
Zach Daniel
c380cc1a14
docs: sanitize things for docs
2022-08-30 16:45:55 -06:00
Zach Daniel
6c40747320
improvement: options for prepending/appending hooks
...
docs: guides improvements
2022-08-28 19:27:44 -06:00
Zach Daniel
1bb3468851
improvement: add tracing and telemetry
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
6c79519b6c
improvement: make long-awaited DSL name changes
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
Zach Daniel
584a927776
improvement: add value_is_key
option for managed relationships
2022-08-22 12:26:31 -04:00
Darren Black
548247a8b7
fix: False default value for argument is nil in changeset ( #364 )
2022-08-22 10:41:25 -04: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
917131c21f
improvement: handle required but not accepted values better
2022-08-17 12:58:43 -04:00
Zach Daniel
b9675295e6
improvement: support authorize?
as a changeset option
2022-08-09 20:25:43 -04:00
Zach Daniel
ca9c80b6b0
improvement: better sanitization around sensitive attributes in filters
...
docs: general doc improvements
2022-07-25 18:47:30 -04:00
Zach Daniel
347907029b
improvement: change always_authorize?
to authorize
for multiple options
2022-07-21 22:23:18 -04:00
zimt28
ed44036400
Improve module names ( #357 )
2022-07-21 10:19:47 -04:00
Zach Daniel
98a64577d9
improvement: add || and && operators
...
improvement: sort parsing helpers
test: fix flaky test
2022-07-19 19:15:23 -04:00
zimt28
81c085b9a3
improvemtn: Add accept_default option ( #351 )
...
* Add accept_default option
2022-07-19 10:03:23 -04:00
Zach Daniel
c9f20f1488
improvement: add process-based actor, tenant and query/changeset context
...
improvement: add `always_authorize?` and `require_actor?` to api config
2022-07-19 00:49:05 -04:00
Frank Dugan III
3776af9f85
feat: add can?/4 policy utility ( #349 )
...
* feat: add can?/4 policy utility
* refactor: change defaults and add can/4
* refactor: add typespecs, rename test
2022-07-14 10:05:51 -04:00
Zach Daniel
a023aaff95
fix: make mnesia and ets work properly when sharing tables
...
fix: make updates properly merge with mnesia and ets
fix: `attribute_writable?` also makes it public
2022-07-13 15:05:55 -04:00
Zach Daniel
ba559936d8
improvement: code_interface optional arguments
...
test: add some load tests
2022-07-11 22:59:51 -04:00
Zach Daniel
0f3521b2f4
improvement: improve behavior of lazy?: true
option
...
before, any calculation that determined that it needed to load
would always load its dependencies, but now if they are already loaded
then dependencies won't be reloaded
2022-07-11 21:31:50 -04:00
Maciej Malecki
9707b4b7fe
Use a proper operator in the attribute_does_not_equal
validation ( #348 )
...
Previously, it was using `if current != expected do raise` while it
needs to do the opposite. Also, simplify the logic by making `update`
work in the same way as `create` (compare upcoming value - not the
original one).
2022-07-07 14:12:32 -04:00
Zach Daniel
40904cae80
fix: add back in writable?
option to relationships, and add attribute_writable?
to belongs_to
2022-07-06 08:30:13 -04:00
Zach Daniel
394e2d089a
improvement: add match_other_defaults?
to attribute
2022-07-05 10:18:50 -04:00
Zach Daniel
ac4590a0ca
improvement: remove relationship writability, as it all happens through arguments now
...
improvement: repurpose `writable?` on `belongs_to` to make the attribute writable
2022-07-05 08:16:38 -04:00
Zach Daniel
f718ee94e7
improvement: new timeout error message and test it
2022-06-27 15:57:30 -04:00
Zach Daniel
ef3d1ea398
improvement: Ash.Generator
2022-06-21 21:00:47 -04:00