Skip to content

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyzerner committed Aug 31, 2021
1 parent 5a01c8f commit 708a94f
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 90 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Query: add `append`, `set`, and `delete` methods.
- Export useful JSON:API types: `JsonApiDocument`, `JsonApiIdentifier`, `JsonApiResource`, `JsonApiRelationships`, and `JsonApiRelationship`.

### Removed
- Query: remove `push` method.

## [0.1.0-beta.4] - 2021-05-26
### Fixed
Expand All @@ -22,6 +28,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release

[Unreleased]: https://github.com/tobyzerner/json-api-models/compare/v0.1.0-beta.4...HEAD

[0.1.0-beta.4]: https://github.com/tobyzerner/json-api-models/compare/v0.1.0-beta.3...v0.1.0-beta.4
[0.1.0-beta.3]: https://github.com/tobyzerner/json-api-models/compare/v0.1.0-beta.1...v0.1.0-beta.3
2 changes: 1 addition & 1 deletion dist/index.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { Store } from './store';
export { Model } from './model';
export { Query } from './query';
export * from './types';
export { Store } from './store';
export { Model } from './model';
export { Query } from './query';
2 changes: 1 addition & 1 deletion dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 0 additions & 27 deletions dist/jsonApi.d.ts

This file was deleted.

48 changes: 27 additions & 21 deletions dist/model.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import { Store } from './store';
import { IJsonApiIdentifier, IJsonApiRelationships, IJsonApiResource, TKeyValueObject } from './jsonApi';
export declare class Model implements IJsonApiResource {
protected store: Store;
type: string;
id: string;
attributes: TKeyValueObject;
relationships: IJsonApiRelationships;
meta: TKeyValueObject;
links: TKeyValueObject;
[field: string]: any;
constructor(data: IJsonApiResource, store: Store);
/**
* Make a resource identifier object for this model.
*/
identifier(): IJsonApiIdentifier;
/**
* Merge new JSON:API resource data into the model.
*/
merge(data: IJsonApiResource): void;
}
import { Store } from './store';
import { JsonApiIdentifier, JsonApiRelationships, JsonApiResource, KeyValueObject } from './types';
export declare type TCastAttributes = {
[key: string]: FunctionConstructor;
};
export declare class Model implements JsonApiResource {
protected store: Store;
type: string;
id: string;
attributes: KeyValueObject;
relationships: JsonApiRelationships;
meta: KeyValueObject;
links: KeyValueObject;
protected casts: TCastAttributes;
[field: string]: any;
constructor(data: JsonApiResource, store: Store);
getAttribute(name: string): any;
getRelationship(name: string): any;
/**
* Make a resource identifier object for this model.
*/
identifier(): JsonApiIdentifier;
/**
* Merge new JSON:API resource data into the model.
*/
merge(data: JsonApiResource): void;
}
17 changes: 11 additions & 6 deletions dist/query.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
export declare class Query {
readonly query: any;
constructor(query?: any);
push(key: object | string, value?: any): this;
toString(): string;
}
export declare class Query {
readonly query: any;
constructor(query?: any);
append(key: string, value: any): this;
append(values: object): this;
set(key: string, value: any): this;
set(values: object): this;
delete(key: string): this;
delete(keys: string[]): this;
toString(): string;
}
Loading

0 comments on commit 708a94f

Please sign in to comment.