Siren
Static Member Summary
Static Public Members | ||
public static get |
Returns an empty siren representation. |
Static Method Summary
Static Public Methods | ||
public static |
Parses a JSON representation of a Siren entity |
|
public static |
Returns a Superagent Promise instance which will perform an HTTP Get against |
Constructor Summary
Public Constructor | ||
public |
constructor(args: *) |
Member Summary
Public Members | ||
public get |
embeddedEntities: Immutable.Set: * Returns the sub-entities on this Siren object which are embedded sub-entities. |
|
public get |
linkedEntities: Immutable.Set: * Returns the sub-entities on the Siren object which are linked sub-entities. |
|
public get |
Returns the self link for this entity |
Method Summary
Public Methods | ||
public |
embeddedEntitiesByRel(rel: String): Immutable.Set Returns the sub-entities on this Siren object which are embedded sub-entities. |
|
public |
findActionByName(name: String): SirenAction Finds the @see SirenAction referenced by the provided rel. |
|
public |
findEntitiesByRel(rel: String): Immutable.Set Finds the @See EmbeddedSubEntity|LinkedSubEntity entities referenced by the provided rel. |
|
public |
findLinkByRel(rel: String): SirenLink Finds the first @See SirenLink referenced by the provided rel. |
|
public |
linkedEntitiesByRel(rel: String): Immutable.Set Returns the set of linked sub-entities on the Siren object which match the requested rel. |
Static Public Members
Static Public Methods
public static fromJson(obj: Object, baseUrl: String): Siren source
Parses a JSON representation of a Siren entity and returns the Siren representation.
public static get(href: String): superagent-promise source
Returns a Superagent Promise instance which will perform an HTTP Get against the provided href returning the response as a SuperAgent response. If the response is Siren ('application/vnd.siren+json'), then the body should be a Siren instance.
Params:
Name | Type | Attribute | Description |
href | String | The URL to perform an HTTP get against |
Return:
superagent-promise | Superagent Promise Object |
Public Constructors
public constructor(args: *) source
Params:
Name | Type | Attribute | Description |
args | * |
Public Members
public get embeddedEntities: Immutable.Set: * source
Returns the sub-entities on this Siren object which are embedded sub-entities.
Return:
Immutable.Set | Set of embedded sub-entities. |
public get linkedEntities: Immutable.Set: * source
Returns the sub-entities on the Siren object which are linked sub-entities.
Return:
Immutable.Set | Set of linked sub-entities on this Siren object. |
Public Methods
public embeddedEntitiesByRel(rel: String): Immutable.Set source
Returns the sub-entities on this Siren object which are embedded sub-entities.
Params:
Name | Type | Attribute | Description |
rel | String | Only entities with a relation to the parent siren matching this should be returned. |
Return:
Immutable.Set | Set of embedded sub-entities which match thes provided rel. |
public findActionByName(name: String): SirenAction source
Finds the @see SirenAction referenced by the provided rel.
Params:
Name | Type | Attribute | Description |
name | String | The name of the action to find. |
public findEntitiesByRel(rel: String): Immutable.Set source
Finds the @See EmbeddedSubEntity|LinkedSubEntity entities referenced by the provided rel.
Params:
Name | Type | Attribute | Description |
rel | String | The relation to this Siren entity for the requested sub-entity. |
Return:
Immutable.Set | Set of sub-entities matching the requested rel. |
public findLinkByRel(rel: String): SirenLink source
Finds the first @See SirenLink referenced by the provided rel.
Params:
Name | Type | Attribute | Description |
rel | String | The relation to this Siren entity for the requested link. |
public linkedEntitiesByRel(rel: String): Immutable.Set source
Returns the set of linked sub-entities on the Siren object which match the requested rel.
Params:
Name | Type | Attribute | Description |
rel | String | Only entities with this relation to the parent siren should be returned. |
Return:
Immutable.Set | Set of linked sub-entities which match the provided rel. |