- Republished [email protected] npm package as [email protected]
- Removed promises from calls to
Association#assign(save: false)
in favor of synchronous assignment
- Added
Base#clone
to clone resources
- Added
#errors
to list of objects/properties cloned inBase#clone
- Added
afterBuild
callback to Resource classes
- Add change tracking to fields, with methods
resource.changed()
andresource.changedFields()
accessible for seeing changes to each resource- Add
klass().attributes()
for specifying attributes to track. - Relationships will automatically be tracked
- Add
- Add
CollectionResponse
object that is returned fromGET
requests to collection endpoints- Provides pagination helpers when response includes pagination links
- Allow
Interfaces.JsonApi
to be overridden easier by making all helper methods prototype properties
- Allow response documents to omit
id
- Append '/' to relationship links
- Refactor links to add storage capability and fix bugs
- Allow
Interfaces.JsonApi
to create default relationship links using resource self link and reflection name if links not otherwise present
- Fix bug in Fields#changedFields collection association new target item finding
- Fix bug in Fields#changedFields resulting from owner relationship resources not being assigned as a field to their children
- Add
resourceLibrary.includePolymorphicRepeats
option that iftrue
allows primary data’s relationships to send polymorphic owner data to the server, despite that data also being the primary data
- Breaking: Switched from
jQuery.ajax
toaxios
, which have different promise interfaces - Breaking: Switched all references of
attribute
inerrors()
object tofield
:error.attribute
is nowerror.field
resource.errors().forField(field)
returns a collection of errors wherefield.startsWith(field)
resource.errors().forAttribute(attribute)
is nowresource.errors().detailsForField(field)
- Potentially breaking: Fixed the incorrect
Content-Type
in default request interface (JsonApi
)- Original:
application/json
- Correct:
application/vnd.api+json
- Original:
- Switch to new build system using
grunt-umd
package instead ofgrunt-umd_wrapper
- Pad
/
on bad URL references to remove ill formatting of query URLs - Fix bug in relationship link name being camelCased in
JsonApi
interface - Add
resourceLibrary.strictAttributes
boolean config option. If true, only attributes defined inklass().attributes()
will be in the result ofresource.attributes()
. If false, any non-function properties of the resource will be returned. - Add
afterRequest
callback that is called after GET, POST, PATCH, PUT requests of a resourceafterBuild
will be called on GET, but it is called before any fields are assigned to the resource
- Add source maps
- Fix bug in array processing in
Interfaces.JsonApi#toCamelCase
andtoUnderscored
- Add source map for dist release
- Allow resources to be provided as values in
where
statements, transforming their primaryKey as value - Use a single instance of
axios
in interfaces, so thatresourceLibrary.interface.axios.request
can be easily stubbed - Fix bug in Interfaces.JsonApi#toCamelCase that mishandles attributes with arrays of strings as the value
- Add pop and shift to Collection
- Fix JSON API interface sending invalid relationship data format when relationship assigned to null
- Add readOnly and readWrite attributes and only send readWrite attributes to server via JsonApi interface
- Add default error message for timeouts to requests
- Add immutable mode that makes all resources immutable and all behavior conform to this
- Reserve
__super__
attribute from being used publicly - Add pretty print for
Base.toString()
- Fix bug that left
Relation#select
field classes camelCased in requests - Add
ResourceLibrary#createResource
that takes in class and composes it withBase
class, calling staticdefine
on it to define fields directly in the class - Allow arrays of values/resources to be supplied as
where
values - Allow
Relation
to inherit custom class methods from the base class it starts from