Class: ServiceDescriptor

ServiceDescriptor

Provides details of a Sequoia Service

This class should not be used directly, but should instead be obtained from Client#service


<private> new ServiceDescriptor(transport, data)

Parameters:
Name Type Description
transport Transport

Transport instance to use for fetching

data Object

JSON data returned from the service's raw description e.g. https://metadata-sandbox.sequoia.piksel.com/descriptor/raw?owner=demo

Properties:
Name Type Description
data Object

JSON data returned from the service's raw description e.g. https://metadata-sandbox.sequoia.piksel.com/descriptor/raw?owner=demo

Source:

Methods


businessEndpoint(name)

Get a BusinessEndpoint from a ServiceDescriptor

Parameters:
Name Type Description
name string

e.g. 'feeds' (the feeds business endpoint from the gateway service)

Source:
Returns:
Type
BusinessEndpoint

resourcefulEndpoint(resourceName)

Get a ResourcefulEndpoint from a ServiceDescriptor

Parameters:
Name Type Description
resourceName string

e.g. 'contents' (the contents resourceful endpoint from the meatatdata service)

Source:
Returns:
Type
ResourcefulEndpoint

resourcefulEndpoints(resourceName)

Get an array of ResourcefulEndpoints from a ServiceDescriptor

Parameters:
Name Type Argument Description
resourceName string <repeatable>

e.g. 'assets', 'contents' (the assets and contents resourceful endpoint from the metadata service)

Source:
Returns:
Type
Array.<ResourcefulEndpoint>
Example
const [ assets, contents ] = service.resourcefulEndpoints('assets', 'contents');

resourcefuls()

Get the list of resourcefuls for this ServiceDescriptor

Source:
To Do:
  • This method isn't used and also does not return an array - it is not advised to use yet
  • Should this return an array of ResourcefulEndpoints instead?
Returns:
  • a list of resourcefuls populated from the descriptor
Type
Array.<Object>