Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Releases: simonedelmann/crud-kit

1.1.0

09 Jan 19:38
Compare
Choose a tag to compare

Async support for public instance

There is a new method func `public`(eventLoop: EventLoop, db: Database) -> EventLoopFuture<Public> in the Publicable protocol, which (by default) converts your public instance to an EventLoopFuture<Public>. You can override that behavior to run asynchronous code and access the database (querying relationships, ...) when calculating your public instance. (See updated README.md and tests for an example.)

Breaking changes
The internal method EventLoopFuture.public() has a new db parameter: func `public`(db: Database).
If you used crud-kit in the documented way, this should not affect you.

1.0.5

04 Jan 15:05
Compare
Choose a tag to compare
  • Fix deprecation warnings in Xcode

1.0.4

21 Jul 09:23
Compare
Choose a tag to compare
  • Update dependencies to use vapor's 4.0.0 release instead of beta
  • Fix deprecation warning for validate(content:)

1.0.3

06 Apr 08:51
Compare
Choose a tag to compare
  • Fix non-public methods on CRUD protocols
  • Improve internal routes setup

1.0.2

05 Apr 12:30
Compare
Choose a tag to compare

Internal Changes only

CRUDController / CRUDChildrenController now base on a protocol CRUDControllerProtocol / CRUDChildrenControllerProtocol, which provides the whole logic. This adds an (currently undocumented) option to use these protocol for own customized controller implementations.

1.0.1

01 Apr 09:09
Compare
Choose a tag to compare

!!! Breaking changes!!!

Rename Crud to CRUD, Crudable to CRUDModel (#1)

1.0.0

31 Mar 19:22
Compare
Choose a tag to compare

Add relationship support

0.0.3

30 Mar 19:13
Compare
Choose a tag to compare

!!! Breaking changes !!!

  • Add a new protocol Crudable, which summarizes Publicable & Createable & Replaceable. Models now have to conform to Crudable by default.

  • Improve Publicable, Createableand Replaceable to not require custom code but provide a default implementation.

// Before
extension Todo: Publicable {
  var `public`: Todo {
    return self
  }
}

// After
extension Todo: Publicable { }
  • Publicable now requires a computed property var public instead of func public()

  • Replaceable now needs replace(with data) to return an instance of Self: func replace(with data: Replace) -> Self

New features

  • The extension .crud() to RoutesBuilder does now support custom routes.
// routes.swift
app.crud("todos", model: Todo.self) { routes in
    // GET /todos/:todos/hello 
    routes.get("hello") { _ in "Hello World" }
}

Changes under the hood

  • CrudController now stores an idComponentKey which defaults to the models endpoint. This is preparing for relationship support.

Improve routing

28 Mar 20:17
Compare
Choose a tag to compare

!!! Breaking changes !!!

Changes the RoutesBuilder extension to natively support the required path:

// Old syntax
routes.group("todos").crud(model: Todo.self)

// New syntax
routes.crud("todos", model: Todo.self)

Initial release

01 Mar 19:31
Compare
Choose a tag to compare

Initial release of crud-kit. Check Readme for more details.