Zach Daniel
41a91b8aa6
fix: don't require values when managing relationships
2021-03-21 23:00:17 -04:00
Zach Daniel
801778abbd
fix: Revert "fix: force_change_attributes before passing to action"
...
This reverts commit 4a0b2035b9
.
2021-03-21 22:17:41 -04:00
Zach Daniel
4a0b2035b9
fix: force_change_attributes before passing to action
2021-03-21 22:11:04 -04:00
Zach Daniel
4e8bd5bfbc
fix: exception on invalid query arguments
2021-03-21 14:19:45 -04:00
Zach Daniel
ac72c623d9
fix: allow casting strings as uuids (for embedded types)
2021-03-21 11:31:25 -04:00
Zach Daniel
ab31320e73
improvement: retain actor context from changeset
2021-03-21 11:31:01 -04:00
Jason Axelson
6c31956b56
improvement: Add float type ( #204 )
...
Also update `Ash.Type` documentation to use the float module as an
example of a custom type.
2021-03-21 00:09:27 -04:00
Zach Daniel
b155a5fb81
improvement: raise informative errors on bad inputs to for_*
2021-03-20 17:17:23 -04:00
Zach Daniel
b98650aeb7
fix: avoid exception in Changeset.new/2
for bad attribute
2021-03-20 17:16:57 -04:00
Zach Daniel
f1a6fb7418
fix: use ecto's uuid type under the hood
2021-03-20 16:27:11 -04:00
Zach Daniel
e206167f27
improvement: make Ash.Error
a public module
2021-03-19 18:23:48 -04:00
Zach Daniel
e0a368365c
improvement: docs/default value for params
2021-03-19 17:07:22 -04:00
Zach Daniel
6cfa91cc63
chore: fix lint
2021-03-18 23:37:34 -04:00
Zach Daniel
c2d121c0fe
fix: set source_field
when replacing belongs_to
relationship
2021-03-18 23:33:56 -04:00
Zach Daniel
60da316f58
fix: don't consider false
as absent value
2021-03-18 23:33:09 -04:00
Zach Daniel
0ef51ce9e6
improvement: trim whitespace in uuid
2021-03-18 23:32:56 -04:00
Zach Daniel
ba6b4202f9
fix: set argument name in manage_relationship
2021-03-18 23:32:12 -04:00
Zach Daniel
f3c85da268
improvement: improve the behavior of defaults
...
functional defaults are added at action time, others are added directly
into the changeset
2021-03-17 22:34:49 -04:00
Zach Daniel
a1c5f1d06f
fix: validate required attributes *after* before_action hooks
2021-03-16 23:09:36 -04:00
Zach Daniel
3e7b798e34
improvement: discard certain empty values for embed input
2021-03-16 21:41:19 -04:00
Zach Daniel
1b972b9598
fix: force_change attrs *after* for_create/update
2021-03-15 15:55:26 -04:00
Zach Daniel
e60acf4167
fix: pattern match errors in manage_relationships
...
fix: clean up some error cases
fix: only default accept to `public` attributes
2021-03-15 15:47:33 -04:00
Zach Daniel
f6026c6895
fix: allow_nil?: false + default interaction
2021-03-14 23:06:18 -04:00
Zach Daniel
a33e0b97b9
docs: fix redundancy in API docs
2021-03-14 18:45:10 -04:00
Zach Daniel
7eea6576a0
docs: fix dangling docs references
2021-03-14 18:29:30 -04:00
Zach Daniel
0109696d54
fix: remove the as
option
2021-03-14 17:50:11 -04:00
Zach Daniel
4df4e9a070
docs: remove interface docs
2021-03-14 17:48:39 -04:00
Jason Axelson
be56174a3d
docs: Fix some documentation warnings ( #196 )
...
i.e. warnings that appear when you run `mix docs`
Although this PR doesn't fix the majority of them, since the majority
are errors from referring to `@moduledoc false` modules in docs and typespecs.
2021-03-14 17:27:12 -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
zimt28
a219bc0c6c
improvement: Add timestamps() attribute ( #198 )
2021-03-14 17:09:38 -04:00
Zach Daniel
5992fc00f7
docs: remove Ash from docs
2021-03-13 16:07:40 -05:00
zimt28
8ae003e382
docs: Update dsl.ex ( #193 )
2021-03-13 09:29:21 -05:00
zimt28
87390946bf
Fix documentation TOC ( #194 )
2021-03-13 09:26:57 -05:00
Zach Daniel
db47a15cf7
fix: properly validate allow_nil?: false
on update
...
fix: properly validate `allow_nil?: false` private attributes
2021-03-13 09:25:13 -05:00
Zach Daniel
3c2ffd8662
fix: set argument default on cast
2021-03-12 22:22:27 -05:00
Zach Daniel
55a35396a4
docs: add primary action docs
2021-03-12 22:22:27 -05:00
zimt28
deba10f236
docs: Fix doc ( #192 )
2021-03-12 22:21:03 -05:00
Zach Daniel
22188d4366
improvement: derive has_one destination_field
...
improvement: finalize code API logic
2021-03-11 23:45:52 -05:00
Zach Daniel
662bbf96b9
fix: fix pub_sub on update
...
improvement: add not_found_message + violation_message for relationships
chore: fix lint
2021-03-10 00:08:26 -05:00
Zach Daniel
68f358d342
improvement: support get_by_<identity>
in interface
...
fix: fix `publish_all` pub_sub notifier
improvement: support sublists in pub_sub topics
improvement: support `:_tenant` in pub_sub topics
2021-03-09 16:16:02 -05:00
Zach Daniel
f4fcfb54a2
improvement: accept tenant
in for_read
...
fix: properly filter aggregates
2021-03-09 01:19:45 -05:00
Zach Daniel
5cfa4d5bf0
improvement: update interface to accept query/changesets
2021-03-08 17:19:13 -05:00
Zach Daniel
50f893e8db
docs: update notifier docs
2021-03-08 17:19:04 -05:00
Zach Daniel
72b5a57a25
feat: functional interface on the Api module
...
feat: resource aliases
improvement: require completely unique action names
2021-03-08 00:59:32 -05:00
Zach Daniel
6e1baad6b2
fix: don't reverse sub-entities in DSL
2021-03-07 15:19:53 -05:00
Zach Daniel
e90fdad34a
feat: support Ash.Query.select/3
and Ash.Changeset.select/3
2021-03-07 14:09:51 -05:00
Zach Daniel
c2cb843be9
improvement: ignore destination field on some relationship inputs
2021-03-05 10:39:06 -05:00
Zach Daniel
80a65db150
improvement: various validation lifecycle options
...
fix: various validation lifecycle fixes
fix: don't fetch sideloads for empty data
2021-03-04 22:48:15 -05:00
Zach Daniel
be576206bd
chore: remove IO.inspect
2021-02-26 15:13:48 -05:00
Zach Daniel
2f8074ff88
fix: fix nested boolean expression optimization
2021-02-26 15:11:14 -05:00
Zach Daniel
02f7d0101b
fix: manage_relationship fixes, input + option defaults
2021-02-24 13:49:27 -05:00
Zach Daniel
e60e5bf281
fix: treat empty string as nil
in manage_relationship
...
fix: be more conservative (and more correct) when optimizing predicates
2021-02-24 11:13:35 -05:00
zimt28
e10b273ce4
Ecto.UUID -> Ash.UUID ( #188 )
2021-02-23 12:27:49 -05:00
Zach Daniel
16d60386aa
fix: fix builtin mange_relationship
change
2021-02-22 23:50:23 -05:00
Zach Daniel
53296fab8b
fix: support belongs_to relationships properly
2021-02-22 23:16:25 -05:00
Zach Daniel
f068055f63
fix: authorize if actor key is present
2021-02-22 21:34:45 -05:00
Zach Daniel
d42c778a0d
improvement: many compile time fixes via code splitting
...
feat: refactored manage_relationship options/behavior
2021-02-22 20:44:03 -05:00
zimt28
db533450ed
improvement: Guess destination_field for has many relationships ( #187 )
2021-02-15 13:32:44 -05:00
Darren Black
983a711837
improvement: Implement string length validation ( #183 )
...
Co-authored-by: Darren Black <darren@ifixsystems.com.au>
2021-02-08 18:16:32 -05:00
Zach Daniel
3739b4c33a
chore: update doc formatting
2021-02-05 19:07:47 -05:00
Zach Daniel
03b6714e6f
improvement: set_context change/preparation
...
fix: support `manage_relationship` for `belongs_to`
2021-02-05 18:56:56 -05:00
Zach Daniel
142b3bf7f9
feat: add default_context
...
feat: add `manage_relationship/4`
feat: add relationship specific context (for postgres polymorphism)
feat: add `reject` (opposite of `accept`)
improvement: set `accept` by default
2021-02-04 17:15:15 -05:00
Zach Daniel
dd26beb79b
chore: add more authorization tests
...
chore: improve authorization test helper
improvement: support `{:filter, _}` authorization results for changesets
2021-01-28 14:49:08 -05:00
Zach Daniel
0ac0be6a1f
fix: only run authorization once per request
...
fix: don't error on replacing empty relationship with empty
improvement: support `tenant` option to `get/2`
improvement: support `message` option on identities
2021-01-26 23:48:00 -05:00
Zach Daniel
1004ceb71d
feat: add after_action
for queries
...
fix: default to calculating filters on `data_layer_query`
2021-01-25 02:14:22 -05:00
Zach Daniel
8e74ff62a6
fix: remove invalid boolean expression optimization
...
improvement: make form errors work better with phoenix
this involves temporarily making embed error messages *worse*
but we can improve them as we get more usage
2021-01-24 13:47:10 -05:00
Zach Daniel
61e6b7c80c
fix: various ci_string improvements
...
feat: add `contains/2` query function
2021-01-23 22:28:56 -05:00
zimt28
63483822d6
Update transformer.ex ( #179 )
2021-01-22 20:26:23 -05:00
Zach Daniel
bb91fd4bc7
fix: add action filters in for_read/3
...
fix: don't let local runner processes mix up messages
fix: runtime filter filters properly
2021-01-22 16:41:32 -05:00
Zach Daniel
7ea9b082f1
improvement: support all string constraints for ci_string
2021-01-21 15:25:07 -05: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
zimt28
6ddae6850f
improvement: Add trim/allow_empty to string type ( #171 )
2021-01-15 20:41:21 -05:00
zimt28
2a7acffabb
Always validate constraints ( #173 )
2021-01-14 10:52:18 -05:00
Zach Daniel
13ca0b2976
chore: generalize DSL tooling
2021-01-14 01:17:26 -05:00
zimt28
31cb4f4be3
improvement: Improve attribute defaults ( #164 )
2021-01-12 15:40:55 -05:00
Zach Daniel
6a26a583de
feat: Add Embedded Resources ( #170 )
2021-01-12 15:05:56 -05:00
zimt28
db6bdfcf15
improvement: Add built in decimal type ( #162 )
2021-01-09 11:58:52 -05:00
zimt28
4404da93ce
fix: Correct error message ( #163 )
2021-01-09 11:36:01 -05:00
Zach Daniel
dbf9f82802
improvement: add Ash.Sort.parse_input/2
...
fix: fix small sort bugs
2021-01-08 14:22:31 -05:00
zimt28
72ba6c4742
improvement: Add built in usec datetime type ( #160 ) ( #161 )
...
improvement!: Use usec timestamps by default
2021-01-08 12:12:37 -05:00
Zach Daniel
7ce72a7454
fix: only cast public relationships/attributes
2021-01-08 02:58:02 -05:00
Zach Daniel
8ef272b1ca
fix: allow_nil?: false
for integer_primary_key
2021-01-07 22:30:41 -05:00
Zach Daniel
424d020a7d
improvement: add for_<action>
helpers
2021-01-07 21:35:40 -05:00
Darren Black
fb5cc74329
improvement: Add built in binary type ( #156 )
...
Co-authored-by: Darren Black <darren@ifixsystems.com.au>
2021-01-06 22:46:20 -05:00
Zach Daniel
109ed9b19c
fix: the __resource__
change broke some extensions
2021-01-06 15:15:43 -05:00
Zach Daniel
6eebe33c29
fix: add back extensions/1
helper to resources
2021-01-06 14:49:30 -05:00
Zach Daniel
86236a5962
fix: lazy loaded module issues (e.g in iex)
2021-01-06 14:39:56 -05:00
Zach Daniel
a886fecfd6
improvement: optimize not-in and fix dialyzer
2020-12-31 18:39:15 -05:00
Zach Daniel
60e0dad7b6
improvement: rework filter creation + subset checking
...
This is one of the most complicated parts of Ash. In order to pass
a filter statement to the satisfiability solver that we use, we have
to first transpile a *value* statement into a *boolean* statement.
This means that we need to embed the knowledge of mutual exclusivity
wherever possible. Authorization still works if the system doesn't know
the relationship between two value statements, as it will attach
the authorization filters if its not sure. But having this in place
should represent a fairly significant optimization in many cases.
Additionally, filter creation has a set of optimizations around the
`eq` and `in` operators to combine them whlie building a boolean
statement
2020-12-31 18:39:15 -05:00
Zach Daniel
d96f54b4c8
docs: format line breaks in bullet points
2020-12-30 17:11:23 -05:00
Zach Daniel
9ebbb6e683
improvement: support autocompletion on Api funcs
2020-12-30 16:45:44 -05:00
Zach Daniel
b16cbf7303
fix: validate read action existence
2020-12-30 15:28:00 -05:00
Zach Daniel
c1767e79b2
improvement: default actions
2020-12-30 11:55:40 -05:00
Zach Daniel
2c996c8168
fix: fix compile issues, add docs
2020-12-30 01:09:02 -05:00
Zach Daniel
251d7e03df
docs: filter parsing docs
2020-12-30 00:58:34 -05:00
Zach Daniel
dcbbd21f0c
improvement: add parse_input/3
to Ash.Filter
2020-12-30 00:49:32 -05:00
Zach Daniel
31e58bfc70
improvement: describe operator types
2020-12-29 14:23:55 -05:00
Zach Daniel
9efe0355e8
fix: only accept kw list in aggregate/5
2020-12-28 19:33:01 -05:00
Zach Daniel
42deba22f0
chore: update aggregate documentation
2020-12-28 19:25:16 -05:00
Zach Daniel
1719d97d2c
chore: update docs
2020-12-28 19:20:52 -05:00