Commit graph

66 commits

Author SHA1 Message Date
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