Commit graph

1826 commits

Author SHA1 Message Date
Zach Daniel
8e2396b0b1 improvement: add mix ash.generate_policy_chart 2023-09-04 01:07:12 -04:00
Zach Daniel
030f240273 fix: include path in unique path for anonymous aggregates 2023-09-01 18:39:38 -04:00
Zach Daniel
e423ec5381 fix: give anonymous aggregates constant names 2023-09-01 17:23:04 -04:00
Barnabas Jovanovics
b661022736
fix: sort operator names in keyset (#684) 2023-09-01 06:53:01 -04:00
Zach Daniel
c5ea541b2d chore: rework atomics to atomic_update change and function
improvement: add `Ash.context_to_opts/1-2`
2023-08-29 14:39:38 -04:00
Zach Daniel
18cb24e7f7
improvement: implement atomics, expression-based changes (#682)
there is still a lot of potential work that needs to be on this front.
1. supporting atomics on create actions.
2. supporting atomics in upserts (this one may actually be much easier than the first one, for postgres specifically, due to ecto implementation details)
3. discovering places atomics can be more nicely integrated into existing changes, validations, policies
2023-08-28 16:05:26 -04:00
Zach Daniel
452ec7df9d chore: format 2023-08-25 13:57:13 -04:00
Zach Daniel
f05bcec2eb improvement: hide __order__ and __lateral_join_source__ on records 2023-08-25 13:21:26 -04:00
Zach Daniel
537d25c68d fix: action.update_default -> field.update_default typo 2023-08-25 12:10:36 -04:00
Zach Daniel
7d5fd04e5c fix: ensure that errors/records return the proper value in bulk creates
closes #681
2023-08-25 08:59:24 -04:00
Zach Daniel
97ab3272db fix: properly optimized nested get_path calls 2023-08-23 12:51:35 -04:00
Zach Daniel
221280f1f5 fix: simplify and fix duplicate detection in embedded resources 2023-08-22 19:02:38 -04:00
Zach Daniel
b3f9a359d7 fix: better handling of runtime maps & lists
fix: properly handle `as` option for calculations in calculation dependencies
2023-08-22 18:26:20 -04:00
Zach Daniel
83b29f7bbd fix: handle inline aggregates in calculation resolver 2023-08-22 15:28:50 -04:00
Zach Daniel
95c5f5f1ac improvement: support in-line aggregates 2023-08-22 14:43:42 -04:00
Zach Daniel
7da453409c chore: credo 2023-08-22 14:31:32 -04:00
Zach Daniel
56a96f04ed fix: init validations at runtime not compile time 2023-08-22 14:29:22 -04:00
James Harton
269889c34b
fix(Ash.Filter): Don't overly constrain related references. (#678)
We now only apply related policies to filter statements based on references
that are explicitly annotated as inputs.  This is the same logic that backs
protecting access in filters for field policies.
2023-08-21 19:39:07 -04:00
Zach Daniel
a37c8b17a8 fix: handle nil constraints in cast_input 2023-08-21 19:26:05 -04:00
Zach Daniel
bd0f89c9dd chore: fix typo 2023-08-21 13:57:10 -04:00
Zach Daniel
34084c52ca fix: properly handle in-line maps in exprs 2023-08-21 13:56:34 -04:00
Zach Daniel
356fa3a780 fix: don't cast notloaded/forbidden values at runtime 2023-08-21 11:35:00 -04:00
Zach Daniel
4adbd47191 fix: add required errors for missing read arguments 2023-08-21 10:14:10 -04:00
Eduardo B. A
3b67313129
improvement: Set api field for ActionInput when running action (#676)
Co-authored-by: Eduardo <sezdocs@dev-distrobox.fedora.local>
2023-08-20 10:06:32 -04:00
Alessio Montagnani
6785e30b68
improvement: make resource's DSL attributes section patchable (#675) 2023-08-19 14:05:19 -04:00
Tchowa Franck A
7e47bfb60f
improvement: validate all actions and accept/reject fields at once. (#674) 2023-08-18 20:47:35 -04:00
Zach Daniel
6136ca693b fix: don't evaluate unknown types in basic operators 2023-08-18 11:37:20 -04:00
Tchowa Franck A
f302dca003
Feature: Ensure aggregate field is attribute or calculation. (#671) 2023-08-17 18:02:05 -04:00
Zach Daniel
50164049df fix: Enum types only have storage_type/0 still 2023-08-17 17:57:50 -04:00
Zach Daniel
b51dbe49c9 improvement: storage_type/0 -> storage_type/1 2023-08-17 17:52:00 -04:00
James Harton
025f75a1aa
improvement(Ash.Resource.Calculation): set struct defaults. (#673) 2023-08-17 18:17:09 +12:00
Zach Daniel
bb8f3334cd improvement: track invalid keys, don't add required errors for them 2023-08-15 22:25:20 -07:00
Zach Daniel
453655326c chore: fix dialyzer 2023-08-15 17:10:07 -07:00
Zach Daniel
46e8dd43bd fix: inspecting a query now only shows arguments explicitly set 2023-08-15 16:52:53 -07:00
Zach Daniel
8233634bb1 improvement: properly set path into error instead of on error messages
TBD: this may break some people's tests, and so may need to be
reverted or released as part of 3.0
2023-08-15 16:23:06 -07:00
Zach Daniel
8c1f334075 improvement: expose union errors with path when tag is set 2023-08-15 14:07:28 -07:00
Zach Daniel
5549bbf290 fix: don't set attributes or arguments to invalid values 2023-08-15 11:00:49 -07:00
Zach Daniel
140a1c9ca3 chore: remove all_loaded 2023-08-14 16:57:08 -07:00
Zach Daniel
72fada1bec improvement: find all installed extensions by default 2023-08-14 16:18:45 -07:00
Zach Daniel
cf9c92f158 improvement: add initial implementation of new mix tasks 2023-08-14 15:30:35 -07:00
Zach Daniel
376ac3889f improvement: add plural_name
fix: handle atomic/string union type identifiers better
2023-08-14 14:09:08 -07:00
Zach Daniel
1291e226c8 fix: handle empty field policy lists better internally 2023-08-11 01:25:50 -07:00
Barnabas Jovanovics
f85bc95ff5
chore: release version v2.14.0 (#669) 2023-08-09 19:43:55 +02:00
Zach Daniel
b1acd6b2f8
fix: optimized boolean expression building typo 2023-08-09 09:46:45 -07:00
Zach Daniel
7ae9244d01 fix: don't optimized in/== predicates across incorrect boolean expressions 2023-08-08 12:17:07 -07:00
Zach Daniel
6daae630f4 fix: various fixes with runtime evaluation of aggregates
fix: handle mnesia transaction errors properly
2023-08-06 00:41:29 -04:00
Zach Daniel
f22a07d613 improvement: add from_many? option to has_one 2023-08-04 18:35:56 -04:00
Zach Daniel
32f8224fba fix: fix badly formatted error message 2023-08-03 20:16:17 -04:00
Zach Daniel
cf99929230 improvement: initialize change opts in bulk actions
fix: better error message in `validate_related_resource_inclusion`
test: add test for arguments in bulk create actions
2023-08-02 12:41:54 -04:00
Zach Daniel
d16e290077 improvement: validate resourcesin apis 2023-07-28 11:51:51 -04:00
Zach Daniel
1871e19fa9 improvement: added round/1 and round/2 to expressions 2023-07-27 11:49:02 -04:00
Zach Daniel
7bbc7ba4e3 improvement: add new/1 to all ash errors, because its nicer 2023-07-26 23:01:29 -04:00
Zach Daniel
f1f1aa8a6e improvement: allow for parent/1 expressions to be resolved "later" 2023-07-26 18:50:20 -04:00
Zach Daniel
bda7c56543 improvement: support parent/1 in relationships 2023-07-26 16:46:22 -04:00
Zach Daniel
b9abe2aa72 fix: handle changeset errors in mnesia transactions 2023-07-24 12:17:06 -04:00
Zach Daniel
78a62feb89 improvement: enrich mnesdia data layer
fix: fix builder for action preparations
2023-07-24 10:23:34 -04:00
Zach Daniel
da73502a2f fix: before/after batch callbacks are no longer broken
test: add tests for those callbacks being executed
2023-07-22 19:51:27 -04:00
Zach Daniel
2fe810f3fc improvement: remove ecto after compile hook
chore: file name typo
2023-07-21 09:11:42 -04:00
Zach Daniel
a85809f634 improvement: add aggregate context when adding aggregates 2023-07-20 21:58:13 -04:00
Zach Daniel
751a718925 fix: try to cast_stored expression calculation results 2023-07-20 20:41:24 -04:00
Minsub Kim
f789bde709
feat: validate arg (#662)
* feat: validate argument unequality

* feat: validate argument in
2023-07-20 08:24:15 -04:00
Rebecca Le
b5edc6fba1
fix: read argument value in ArgumentEquals validation (#664) 2023-07-20 08:04:21 -04:00
Zach Daniel
0d0abf4fda improvement: support distinct_sort in Query.build/2 2023-07-19 12:51:37 -04:00
Zach Daniel
20877f18b5 improvement: inspect distinct_sort 2023-07-19 12:27:22 -04:00
Zach Daniel
e5563ce664 fix: Keyword.fetch on keywords, fix test name 2023-07-19 11:18:20 -04:00
Zach Daniel
7f3ec1b8bf improvement: support distinct_sort 2023-07-19 11:06:01 -04:00
Spark Kim
3a827c85e4
feat: validate argument equality (#659) 2023-07-19 09:49:46 -04:00
Mariusz Morawski
7f165ce99f
chore: Remove leftover commented out debug code (#658) 2023-07-19 09:48:59 -04:00
Zach Daniel
ac4d803cc0 chore: fix typo 2023-07-18 15:54:38 -04:00
Zach Daniel
c0eec23abb improvement: use Comp.equal? for actor_attribute_equals check 2023-07-18 15:54:03 -04:00
Zach Daniel
3c42062861 fix: allow the query & related fields to be read before authorization status is complete 2023-07-18 15:23:27 -04:00
Zach Daniel
5b2efe5e5c improvement: support distincting on calculations
improvement: support distinct in ets data layer for testing
2023-07-18 14:35:25 -04:00
Zach Daniel
bae2aa2ad2 fix: only depend on calcs in runtime calcs 2023-07-18 13:02:38 -04:00
Zach Daniel
d98f66da6f fix: handle manual relationships where source field doesn't exist 2023-07-18 07:49:00 -04:00
Zach Daniel
4508d1d469 improvement: support the - unary operator
yknow, because numbers are negative sometimes
2023-07-17 22:22:09 -04:00
Zach Daniel
3af1b8a994 fix: only error on incorrect destination managed relationships when they are resources 2023-07-14 15:33:54 -04:00
Eliel Gordon
216755b275
fix set_tenant spec (#655) 2023-07-14 12:38:56 -04:00
Zach Daniel
fcc319d965 improvement: add ForbiddenField exception 2023-07-13 09:05:04 -04:00
Zach Daniel
94815605b9 improvement: warn on api missing from config 2023-07-13 08:42:52 -04:00
Zach Daniel
9987cb05e8 chore: better error message on resource in no apis 2023-07-13 08:23:13 -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
7114b5efbb improvement: exists type aggregate 2023-07-13 00:08:51 -04:00
Zach Daniel
2634d3d830 improvement: add at/2 function 2023-07-12 16:53:43 -04:00
Zach Daniel
d27e871b8f improvement: add string_split expression 2023-07-12 15:11:21 -04:00
skanderm
925f5c1f9a
fix: incorrect error for casting binary UUID (#653) 2023-07-11 20:35:01 -04:00
Zach Daniel
8e12a14b25 improvement: add field_policy_bypass
fix: fix and improve policy breakdown logs
improvement: optimize field selection/loading when possible
2023-07-11 10:28:07 -04:00
Zach Daniel
07d7dd5491 improvement: deselect fields we know statically are not visible 2023-07-11 09:23:25 -04:00
James Harton
ebbbcca301
fix: incorrect typespec for bulk_create/5. (#646) 2023-07-10 19:31:07 -04:00
Zach Daniel
1d2a04d972 chore: optimize replace_dynamic_loads/4 2023-07-10 09:02:53 -04:00
Barnabas Jovanovics
c442d83534
test: add test for aggregate field policy (#644) 2023-07-10 09:00:55 -04:00
James Harton
13a14674d0
fix: add handle_change/3 and prepare_change/3 to Ash.Type.Union (#642) 2023-07-10 11:55:53 +12:00
Zach Daniel
be75743b13 fix: properly detect selected attributes for changeset field policies 2023-07-06 10:58:09 -04:00
Mariusz Morawski
5ed2109e33
improvement: Add Negate validation (#636)
* Add `Negate` validation
---------

Co-authored-by: Zach Daniel <zachary.s.daniel@gmail.com>
2023-07-05 16:25:51 -04:00
Zach Daniel
93d4f1fd26 fix: run before_action after authorization 2023-07-05 11:51:54 -04:00
Zach Daniel
d9687c7b1f fix: return accumulator to correct state after altering exists 2023-07-04 09:39:12 -04:00
Alan Heywood
4ab7e84e4f
fix: typo in at_most validation message (#640) 2023-07-04 08:59:12 -04:00
Zach Daniel
102522adf7 fix: select attributes in load statement 2023-07-03 22:44:11 -04:00
Zach Daniel
60c96c7a1d fix: don't loan unless we need to for runtime filters 2023-07-03 12:23:35 -04:00
Zach Daniel
835515ecc6 fix: load after all hooks have completed 2023-06-28 21:04:31 -04:00
Zach Daniel
b86c66b505 fix: don't allow is_nil as an expression operator 2023-06-28 16:41:34 -04:00