Commit graph

151 commits

Author SHA1 Message Date
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
f823e35f7d fix: actually use warn_on_empty? config 2022-08-01 19:23:16 -04:00
Zach Daniel
347907029b improvement: change always_authorize? to authorize for multiple options 2022-07-21 22:23:18 -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
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
b3e0632792 improvement: move ash_policy_authorizer into core as Ash.Policy.Authorizer 2022-05-17 15:56:40 -04:00
Zach Daniel
904968b936 improvement: add no_fields? relationships 2022-05-03 18:56:37 -04:00
Zach Daniel
7a1e32908a improvement: more flow features/fixes, debug step 2022-04-25 17:01:23 -04:00
Zach Daniel
4e19223173 improvement: tons of engine/timeout improvements 2022-04-17 23:56:01 -04:00
Zach Daniel
9f21435dbf fix: fix expression logic
improvement: flow -> mermaid chart
improvement: flow tenants
improvement: fix nested map statements in flow
2022-04-10 20:00:57 -04:00
Zach Daniel
c98910add6 improvement: add dynamic allow list
improvement: uniqify list_references
2022-04-07 22:33:48 -04:00
Zach Daniel
0309f7131e improvement: fully deprecate the resource entity 2022-04-06 13:12:22 -04:00
Zach Daniel
be9e564d57 chore: fix identity docs/tests 2022-04-06 12:22:34 -04:00
Zach Daniel
4fc53baf5f improvement: add eager validate identities
improvement: percolate `nil` values in operators in ash expresion language (like SQL)
chore: more docs work
2022-04-06 12:00:32 -04:00
Zach Daniel
84ed398980 chore: docs/ci work 2022-04-05 03:59:34 -04:00
Zach Daniel
ae630581ea improvement: better loading behavior for managed relationships
improvement: add lazy? option for loading
2022-04-01 15:17:01 -04:00
Zach Daniel
c7ff13c2ef chore: build/lint 2022-03-30 11:37:44 -04:00
Zach Daniel
f9734af48c chore: get final tests passing 2022-03-24 23:36:43 -04:00
Zach Daniel
96c45e1a58 improvement: add transaction steps to flow
fix: don't require `writable?: false` attributes
2022-03-19 23:51:45 -04:00
Zach Daniel
a53b61ddf4 feat: add Ash.Flow
feat: support recursive DSL entities.
improvement: unimport to avoid name collisions in nested DSLs
2022-03-15 17:42:29 -04:00
Zach Daniel
ba1b39536e feat: manual relationships
fix: make the formatter safer, again
2022-02-20 22:46:39 -05:00
Zach Daniel
15bdae0d99 feat: add source option to attributes 2022-02-14 11:38:45 -05:00
Zach Daniel
079b941e90 chore: release version v1.50.18 2022-02-07 15:39:12 -05:00
Zach Daniel
1b2d28eb90 fix: no IO.inspect, and log errors from formatting 2022-02-02 17:14:29 -05:00
Zach Daniel
4138bd4934 improvement: initial implementation of ash resource formatter 2022-02-02 17:02:43 -05:00
Zach Daniel
ca631d27da improvement: only_when_valid? on changes
fix: set storage_type to `:uuid` for Ash.Type.UUID
2021-11-01 04:39:13 -04:00
Zach Daniel
05d8eb1741 improvement: add allow_async? to calculations, default to false
improvement: add elixir evaluation step to expression calculations
2021-10-25 17:53:51 -04:00
Zach Daniel
5e6442c3e4 improvement: add get_by and get_by_identity to code interface
improvement: compile time validations for managed relationships
2021-10-19 21:39:30 -04:00
Zach Daniel
3bad25c1e0 improvement: add primary_actions? option 2021-10-19 04:42:35 -04:00
Zach Daniel
1f2f9802a3 fix: fix code interface on resources
improvement: breaking change! api level code interface *removed*, contact me on discord if you want a way to avoid changing to resource-based interface, but otherwise
switch to the resource based one by specifying `define_for YourApp.YourApi` in the `code_interface` block of each resource.
improvement: use proper equality checking in places where we were using simple elixir equality checking
2021-10-13 18:42:42 -04:00
Zach Daniel
922c87ea85 improvement: add resource registry validation
fix: move related field validations to resource
fix: remove join_attributes, which didn't do anything anyway
2021-10-11 15:14:33 -04:00
Zach Daniel
ff756b72a7 improvement: deprecation!
A deprecation warning will be shown at compile time to illustrate
a change from listing all of your resources in an api to listing
them in a registry and connecting that registry to the api
2021-10-07 02:41:02 -04:00
Zach Daniel
87627993b8 improvement: breaking change! don't define code interface by default
In an effort to improve compile times in general, and remove unnecessary
compile time dependencies, the code interface is not defined by default.
It is also now possible to define the code interface directly in the resource module,
via

```elixir
code_interface do
  define_for ApiModule
end
```

If you need to reenable the code interface, simply add the following to your api module:
```elixir
resources do
  define_interfaces? true
  ...
end
```
2021-10-06 17:43:22 -04:00
Michael St Clair
8af32a0053
chore: Bring over changes committed to master branch (#271)
Co-authored-by: kernel-io <git@omnium.co>
Co-authored-by: Zach Daniel <zach@zachdaniel.dev>
Co-authored-by: kernel-io <kernel-io@users.noreply.github.com>
2021-10-01 23:27:35 -04:00
Zach Daniel
16629a23f1 chore: update .formatter.exs 2021-09-14 17:19:10 -04:00
Zach Daniel
47bacbfe84 chore: fix lint/format 2021-08-27 20:35:25 -04:00
Zach Daniel
dc56376d80 improvement: add error_handler for create/update/destroy actions 2021-06-23 17:19:59 -04:00
Zach Daniel
231eeafd30 feat: expression calculations for sorting/filtering
improvement: small improvements/fixes across the board
2021-06-04 01:37:11 -04:00
Zach Daniel
4662c23f68 improvement: calculation.select/2 + select calculation option 2021-05-20 16:42:26 -04:00
Zach Daniel
0f6d5e861d chore: fix formatter 2021-05-20 12:19:47 -04:00
Zach Daniel
dd40b24bf9 improvement: transactions for reads, notifications from read callbacks 2021-05-14 11:25:42 -04:00
Zach Daniel
574f6f59a3 improvement: various managed relationship improvements
fix: rename `context` -> `relationship_context` to avoid conflict
feat: `on_no_match: :match` supported for to_one rels
2021-05-14 01:07:51 -04:00
Zach Daniel
7d37f8ae3d improvement: add manual? option for create/update/destroy 2021-05-09 16:25:39 -04:00
Zach Daniel
593b111069 improvement: add read_action option
feat: rework lateral joins for many to many performance boost
2021-05-03 16:21:29 -04:00
Zach Daniel
e11f399fc0 improvement: add :list aggregate kind 2021-04-26 16:01:39 -04:00
Zach Daniel
53ceb5b753 fix: compile time fixes
improvement: add `require_attributes` to create/update/destroy
2021-04-23 11:41:13 -04:00
Zach Daniel
e353ea49c3 fix: allow api.load/2 to load calculations
improvement: add `allow_nil_input` to create actions for api layers
improvement: add `load/1` builtin change
feat: change `get?: true` interface functions to raise on `nil`
2021-04-13 15:49:42 -04:00
Zach Daniel
ec57f363ed improvement: support the datalayer selecting fields in reads 2021-04-09 00:10:01 -04:00
Michael St Clair
6805d431ac
improvement: add sum aggregate (#221) 2021-04-04 16:00:53 -04:00
Zach Daniel
92344029d3 improvement: before_action? on validate, validate inline 2021-04-01 11:53:52 -04:00
Zach Daniel
afddb212f6 chore: fix formatter 2021-03-14 17:51:49 -04: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
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
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
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
6a26a583de
feat: Add Embedded Resources (#170) 2021-01-12 15:05:56 -05:00
Zach Daniel
c0d191b130 chore: fix formatter 2020-12-30 11:56:22 -05:00
Zach Daniel
d600c55509
feat: support :first aggregate (#153)
feat: support more sort orders
2020-12-28 19:18:01 -05:00
Zach Daniel
6f6aed5b36 chore: update formatter 2020-12-01 00:31:19 -05:00
Zach Daniel
c493c1616b
feat: add uuid_primary_key/2 and integer_primary_key/2 2020-11-07 00:31:13 -05:00
Zach Daniel
2333d01ddf
feat: multitenancy! and tons of various fixes (#139) 2020-10-28 01:14:17 -04:00
Zach Daniel
1bf2058233
fix: various fixes and improvements 2020-10-20 18:50:11 -04:00
Zach Daniel
b0bfec7e0f
feat: pubsub notifier (#134) 2020-10-17 13:06:27 -04:00
Zach Daniel
f8fadc67e6
feat: Add pagination (#131) 2020-10-11 23:55:47 -04:00
Zach Daniel
f41cc77549
Various Improvements (#113) 2020-09-19 15:46:34 -04:00
Zach Daniel
5552ce1f83
fix: remove delegate data layer (#112)
The delegation data layer was the wrong tactic. We should model
shared behavior as composition, not inheritance (which is essentially
what the delegation data layer turned into)
2020-09-06 01:16:21 -04:00
Zach Daniel
243c9f05a2
feat: required belongs_to relationships (#107)
fix: various delegate data layer improvements

fix: engine halting issues

feat: support filter templates on read actions

feat: builtin concat calculation
2020-09-01 23:34:55 -04:00
Zach Daniel
9a3962d47a
feat: add changes to actions (#106) 2020-08-30 03:15:16 -04:00
Zach Daniel
a58367414d
feat: add accept option to create/update actions (#105) 2020-08-28 02:58:03 -04:00
Zach Daniel
385ec0b423
feat: add identities, to enhance get calls (#99) 2020-08-25 02:06:01 -04:00
Zach Daniel
2ef877ee53
feat: initial calculation support (#98)
* feat: initial calculation support
2020-08-25 00:49:07 -04:00
Zach Daniel
a56fdbb3ff
feat: Add delegate datalayer (#97) 2020-08-22 18:44:05 -04:00
Zach Daniel
be74d1e7eb
feat: add named aggregates 2020-08-08 16:17:52 -04:00
Zach Daniel
9d51ec6300
feat: allow editing join association attributes 2020-07-16 19:17:01 -04:00
Zach Daniel
28982f03fd
feat: various small refactors + validations 2020-07-15 01:38:42 -04:00
Zach Daniel
2cf41b966e
feat: refactor changes into changesets 2020-07-12 02:25:53 -04:00
Zach Daniel
05848d5f4a
feat: refactor ash types to modules, add constraints 2020-06-30 17:29:43 -04:00
Zach Daniel
807b16e268
fix: move to simpler transaction logic 2020-06-29 17:42:01 -04:00
Zach Daniel
c89acce635
fix: remove reverse relationships 2020-06-22 00:34:44 -04:00
Zach Daniel
b6101a4dff
feat: extension section module imports, generated .formatter.exs (#71) 2020-06-15 02:40:33 -04:00
Zach Daniel
099330559d
fix: various small improvements 2020-05-15 00:29:47 -04:00
Zach Daniel
596a8e3d75
improvement: remove pagination, add query struct (unused) 2020-05-09 22:23:23 -04:00
Zach Daniel
4d73d771ea
improvement: add DslBuilder pattern for deriving dsl blocks 2020-05-07 00:12:29 -04:00
Zach Daniel
e90023f75d
remove deafults in actions 2019-12-06 02:06:34 -05:00
Zach Daniel
9f525d15ae
WIP 2019-12-02 11:25:00 -05:00
Zach Daniel
dd081977a0
WIP 2019-12-01 16:58:29 -05:00
Zach Daniel
8682c4e83b
WIP 2019-11-25 12:08:38 -05:00
Zach Daniel
e57f3961ad
WIP 2019-11-24 19:01:21 -05:00
Zach Daniel
3c1ef49950
whew 2019-11-02 16:36:46 -04:00
Zach Daniel
9cb52f55a7
adding includes support 2019-10-05 20:33:38 -04:00
Zach Daniel
d250271cd1
add relationship route for has one 2019-10-04 04:30:25 -04:00
Zach Daniel
daa8b7ca84
remove example, add functionality 2019-10-03 15:07:57 -04:00
Zach Daniel
b693519ef7
add basic serialization 2019-10-03 03:40:37 -04:00
Zach Daniel
91a4f814ab
move example code into examples 2019-10-03 02:11:34 -04:00
Zach Daniel
9a4c5217f1
WIP 2019-10-03 00:36:32 -04:00