Home Reference Source Repository
import StoreProxy from 'schema-mapper-store/lib/storeProxy.js'
public class | source

StoreProxy

Makes sure execution of commands are paused when a project is being tagged.

Constructor Summary

Public Constructor
public

constructor(store: Store)

Create a new StoreProxy instance

Member Summary

Public Members
public
public
public

store: *

Method Summary

Public Methods
public

Apply multiple changes to the store

public

delItem(projectId: String, schemaId: String, itemId: String): Promise

Remove an item

public

Retrieve all projects at all versions

public

handle(command: Object): Promise

Handle a command

public

putItem(projectId: String, schemaId: String, item: Item, projectVersion: Number): Promise

Store an item

Protected Methods
protected

Retrieve a project collection

protected

Decides wether a command should be paused

protected

Continue handling commands

Public Constructors

public constructor(store: Store) source

Create a new StoreProxy instance

Params:

NameTypeAttributeDescription
store Store

The store to hand off commands to

Public Members

public isPaused: boolean source

public pendingCommands: * source

public store: * source

Public Methods

public applyChanges(changes: Changes): Promise source

Apply multiple changes to the store

Params:

NameTypeAttributeDescription
changes Changes

Array of changes

Return:

Promise

public delItem(projectId: String, schemaId: String, itemId: String): Promise source

Remove an item

Params:

NameTypeAttributeDescription
projectId String
schemaId String
itemId String

Return:

Promise

public getAllProjects(): Object source

Retrieve all projects at all versions

Return:

Object

All projects

public handle(command: Object): Promise source

Handle a command

Params:

NameTypeAttributeDescription
command Object

A command to execute

Return:

Promise

Return Properties:

NameTypeAttributeDescription
method String

The method to call on the store

args Array

The arguments to apply to the method

public putItem(projectId: String, schemaId: String, item: Item, projectVersion: Number): Promise source

Store an item

Params:

NameTypeAttributeDescription
projectId String
schemaId String
item Item
projectVersion Number

Return:

Promise

Protected Methods

protected getProjectCollection(): ProjectCollection source

Retrieve a project collection

protected shouldBePaused(command: Object): Boolean source

Decides wether a command should be paused

Params:

NameTypeAttributeDescription
command Object

A command

Return:

Boolean

Return Properties:

NameTypeAttributeDescription
method String

The method to call on the store

args Array

The arguments to apply to the method

protected unpause() source

Continue handling commands