Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hmcts/draft-store-client

Package Overview
Dependencies
Maintainers
14
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hmcts/draft-store-client

JavaScript client for draft store

  • 1.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

@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

FAQs

Package last updated on 27 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc