ChinoAPISchemas

ChinoAPISchemas

new ChinoAPISchemas(baseUrl, customerId, customerKey)

Create a caller for Schemas Chino APIs

Parameters:
Name Type Default Description
baseUrl string

The url endpoint for APIs

customerId string

The Chino customer id or bearer token

customerKey string | null null

The Chino customer key or null (not provided)

Source:

Methods

create(repositoryId, data) → {Promise.<objects.Schema, objects.ChinoException>}

Create a new schema inside repository selected by its id with data as schema information

Parameters:
Name Type Description
repositoryId string
data object
Source:
Returns:

A promise that return a Schema object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Schema, objects.ChinoException>

delete(schemaId, force, all_content) → {Promise.<objects.Success, objects.ChinoException>}

Deactivate (or delete) schema selected by its id

Parameters:
Name Type Default Description
schemaId string
force boolean false

If true delete schema information otherwise only deactivate it. Default value is false (deactivate)

all_content boolean

If true all the documents inside the schema will deleted otherwise it is not possible to delete a schema unless is empty. Default value is false.

Source:
Returns:

A promise that return a Success object if resolved,X otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Success, objects.ChinoException>

details(schemaId) → {Promise.<objects.Schema, objects.ChinoException>}

Return information about schema selected by its id

Parameters:
Name Type Description
schemaId string
Source:
Returns:

A promise that return a Schema object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Schema, objects.ChinoException>

list(repositoryId, offset, limit) → {Promise.<Array, objects.ChinoException>}

Return a list of current schemas inside the repository selected by its id

Parameters:
Name Type Default Description
repositoryId string
offset int 0
limit int 10
Source:
Returns:

A promise that return a list of Schema object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<Array, objects.ChinoException>

update(schemaId, data) → {Promise.<objects.Schema, objects.ChinoException>}

Update information about schema selected by its id with data as new schema information

Parameters:
Name Type Description
schemaId string
data object
Source:
Returns:

A promise that return a Schema object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Schema, objects.ChinoException>