@hmcts/draft-store-client
JavaScript client for draft store
Last updated a year ago by damdun .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @hmcts/draft-store-client 
SYNC missed versions from official npm registry.

@hmcts/draft-store-client

Greenkeeper badge

Standard - JavaScript Style Guide

This is a client library for interacting with the draft store api

To configure the draft store client you need to:

  • Implement the ServiceAuthTokenFactory interface.
export interface ServiceAuthTokenFactory {
     get (): Promise<ServiceAuthToken>
   }
  • Sample implementation:
let token: ServiceAuthToken

export class ServiceAuthTokenFactoryImpl implements ServiceAuthTokenFactory{
  async get (): Promise<ServiceAuthToken> {
    if (token === undefined || token.hasExpired()) {
      token = await IdamClient.retrieveServiceToken()
    }
    return token
  }
}

API available with clients

  • DraftService provides wrapper around creating DraftStoreClientFactory to save and delete draft documents
  • DraftStoreClientFactory is responsible for creating DraftStoreClients
  • DraftStoreClient is responsible for search, save and delete of draft store data
  • DraftMiddleware manages number of draft store client can be configured and is available if user is logged in

To add library

yarn add @hmcts/draft-store-client

Getting Started

Prerequisites

Running the application

Install dependencies by executing the following command:

$ yarn install

Developing

Code style

We use TSLint with StandardJS rules

Running the linting: yarn lint

Running the tests

Mocha is used for writing tests.

Run them with:

$ yarn test

For test coverage:

$ yarn test:coverage

License

This project is licensed under the MIT License - see the LICENSE file for details

Current Tags

  • 1.2.1                                ...           latest (a year ago)

25 Versions

  • 1.2.1                                ...           a year ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.21                                ...           a year ago
  • 1.0.20                                ...           a year ago
  • 1.0.19                                ...           a year ago
  • 1.0.18                                ...           a year ago
  • 1.0.17                                ...           a year ago
  • 1.0.16                                ...           a year ago
  • 1.0.14                                ...           a year ago
  • 1.0.13                                ...           a year ago
  • 1.0.12                                ...           a year ago
  • 1.0.11                                ...           a year ago
  • 1.0.10-beta                                ...           a year ago
  • 1.0.10                                ...           a year ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago

Copyright 2014 - 2018 © taobao.org |