Skip to content

Commit

Permalink
feat(response): slim response API
Browse files Browse the repository at this point in the history
removes IEntity and leaves it up to IResponsePayload to define such behavior
  • Loading branch information
MichaelHirn committed Jun 4, 2020
1 parent a8bfd7f commit 7985769
Show file tree
Hide file tree
Showing 24 changed files with 578 additions and 344 deletions.
16 changes: 0 additions & 16 deletions docs/markdown/core.ientity.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/markdown/core.ientityconstructor.fromresources.md

This file was deleted.

39 changes: 0 additions & 39 deletions docs/markdown/core.ientityconstructor.md

This file was deleted.

3 changes: 1 addition & 2 deletions docs/markdown/core.iresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface IResponse

## Remarks

A [IResponse](./core.iresponse.md) can be transformed into [IResourceResponse](./core.iresourceresponse.md) or [IEntity](./core.ientity.md) responses which extract the more and the most relevant data from an [IResponse](./core.iresponse.md)<!-- -->.
A [IResponse](./core.iresponse.md) can be transformed into a [IResourceResponse](./core.iresourceresponse.md) which extracts the most relevant data from an [IResponse](./core.iresponse.md)<!-- -->.

Service repositories should create their own response class implementing [IResponse](./core.iresponse.md)<!-- -->.

Expand All @@ -35,6 +35,5 @@ Service repositories should create their own response class implementing [IRespo

| Method | Description |
| --- | --- |
| [toEntity(entity)](./core.iresponse.toentity.md) | <b><i>(BETA)</i></b> Creates an [IEntity](./core.ientity.md) from an [IResponse](./core.iresponse.md) instance. |
| [toResources()](./core.iresponse.toresources.md) | <b><i>(BETA)</i></b> Creates a [IResponseResponse](./core.iresponseresponse.md) from an [IResponse](./core.iresponse.md) instance. |

27 changes: 0 additions & 27 deletions docs/markdown/core.iresponse.toentity.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/markdown/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Provides the core abstractions and functionality.

| Class | Description |
| --- | --- |
| [ResourcePayload](./core.resourcepayload.md) | <b><i>(BETA)</i></b> |
| [ResourceResponse](./core.resourceresponse.md) | <b><i>(BETA)</i></b> Abstract implementation of [IResourceResponse](./core.iresourceresponse.md)<!-- -->. Extends [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)<!-- -->. |
| [Response\_2](./core.response_2.md) | <b><i>(BETA)</i></b> see [IResponse](./core.iresponse.md) |

## Interfaces

| Interface | Description |
| --- | --- |
| [IEntity](./core.ientity.md) | <b><i>(BETA)</i></b> A entity usually extracted from a [IResponse](./core.iresponse.md) via [IResponse.toEntity()](./core.iresponse.toentity.md)<!-- -->. |
| [IEntityConstructor](./core.ientityconstructor.md) | <b><i>(BETA)</i></b> A EntityConstructor used to build [IEntity](./core.ientity.md) from [Resources](./core.iresourcepayload.md)<!-- -->. |
| [IResourcePayload](./core.iresourcepayload.md) | <b><i>(BETA)</i></b> |
| [IResourceResponse](./core.iresourceresponse.md) | <b><i>(BETA)</i></b> Holds none, one, or many [Resources](./core.iresourcepayload.md) and is usually created via [IResponse.toResources()](./core.iresponse.toresources.md)<!-- -->. |
| [IResponse](./core.iresponse.md) | <b><i>(BETA)</i></b> The raw response from a service including any (xhrs) requests and responses and meta information. |
Expand Down
22 changes: 22 additions & 0 deletions docs/markdown/core.resourcepayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [ResourcePayload](./core.resourcepayload.md)

## ResourcePayload class

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>

<b>Signature:</b>

```typescript
export declare abstract class ResourcePayload implements IResourcePayload
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [sha1()](./core.resourcepayload.sha1.md) | | <b><i>(BETA)</i></b> See [IResourcePayload.sha1()](./core.iresourcepayload.sha1.md)<!-- -->. |
24 changes: 24 additions & 0 deletions docs/markdown/core.resourcepayload.sha1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [ResourcePayload](./core.resourcepayload.md) &gt; [sha1](./core.resourcepayload.sha1.md)

## ResourcePayload.sha1() method

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
See [IResourcePayload.sha1()](./core.iresourcepayload.sha1.md)<!-- -->.

<b>Signature:</b>

```typescript
sha1(): string;
```
<b>Returns:</b>

string

## Remarks

Does not omit any properties of the resource

Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [IEntityConstructor](./core.ientityconstructor.md) &gt; [(new)](./core.ientityconstructor._new_.md)
[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md) &gt; [(constructor)](./core.response_2._constructor_.md)

## IEntityConstructor.(new)
## Response\_2.(constructor)

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
Constructs a new instance of the `Response` class

<b>Signature:</b>

```typescript
new (...args: any[]): IEntity;
constructor(serializedResponse: any);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| args | any\[\] | |
<b>Returns:</b>
[IEntity](./core.ientity.md)
| serializedResponse | any | |

14 changes: 14 additions & 0 deletions docs/markdown/core.response_2.main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md) &gt; [main](./core.response_2.main.md)

## Response\_2.main property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
<b>Signature:</b>

```typescript
main: IResponseResponse;
```
38 changes: 38 additions & 0 deletions docs/markdown/core.response_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md)

## Response\_2 class

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
see [IResponse](./core.iresponse.md)

<b>Signature:</b>

```typescript
export declare abstract class Response implements IResponse
```
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(serializedResponse)](./core.response_2._constructor_.md) | | <b><i>(BETA)</i></b> Constructs a new instance of the <code>Response</code> class |
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [main](./core.response_2.main.md) | | [IResponseResponse](./core.iresponseresponse.md) | <b><i>(BETA)</i></b> |
| [meta](./core.response_2.meta.md) | | [IResponseMeta](./core.iresponsemeta.md) | <b><i>(BETA)</i></b> |
| [page](./core.response_2.page.md) | | [IResponsePage](./core.iresponsepage.md) | <b><i>(BETA)</i></b> |
| [xhrs](./core.response_2.xhrs.md) | | [IResponseResponse](./core.iresponseresponse.md)<!-- -->\[\] | <b><i>(BETA)</i></b> |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [toResources()](./core.response_2.toresources.md) | | <b><i>(BETA)</i></b> see [IResponse.toResources()](./core.iresponse.toresources.md)<!-- -->. Needs to be implemented by services. |
14 changes: 14 additions & 0 deletions docs/markdown/core.response_2.meta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md) &gt; [meta](./core.response_2.meta.md)

## Response\_2.meta property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
<b>Signature:</b>

```typescript
meta: IResponseMeta;
```
14 changes: 14 additions & 0 deletions docs/markdown/core.response_2.page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md) &gt; [page](./core.response_2.page.md)

## Response\_2.page property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
<b>Signature:</b>

```typescript
page: IResponsePage;
```
20 changes: 20 additions & 0 deletions docs/markdown/core.response_2.toresources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md) &gt; [toResources](./core.response_2.toresources.md)

## Response\_2.toResources() method

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
see [IResponse.toResources()](./core.iresponse.toresources.md)<!-- -->. Needs to be implemented by services.

<b>Signature:</b>

```typescript
toResources(): ResourceResponse<ResourcePayload>;
```
<b>Returns:</b>

[ResourceResponse](./core.resourceresponse.md)<!-- -->&lt;[ResourcePayload](./core.resourcepayload.md)<!-- -->&gt;

14 changes: 14 additions & 0 deletions docs/markdown/core.response_2.xhrs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@authless/core](./core.md) &gt; [Response\_2](./core.response_2.md) &gt; [xhrs](./core.response_2.xhrs.md)

## Response\_2.xhrs property

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>
<b>Signature:</b>

```typescript
xhrs: IResponseResponse[];
```
Loading

0 comments on commit 7985769

Please sign in to comment.