@enigmatis/polaris-common
TypeScript icon, indicating that this package has built-in type declarations

1.4.5 • Public • Published

Small Logo

polaris-common

Build Status NPM version

This library offers you common classes and interfaces used in polaris.

PolarisRequestHeaders

This interface represents the headers of a polaris graphql request.

  • dataVersion(number - Optional) - the data version to filter with.
  • includeLinkedOper(boolean - Optional) - indicates if should filter linked data from reality zero.
  • requestId(string - Optional) - id of the request. if not given then it's generated.
  • realityId(number - Optional) - the reality id to filter with.
  • requestingSystemId(string - Optional) - the id of the system that made the request.
  • requestingSystemName(string - Optional) - the name of the system that made the request.
  • upn(string - Optional) - the id of the client that made the request.

PolarisResponseHeaders

This interface represents the returned headers from a request to a polaris based data service. It contains realityId, requestId and upn.

PolarisBaseContext

This interface represents the base context, it contains request (PolarisRequestHeaders) and response (PolarisResponseHeaders) headers (specified above) and the client ip.

PolarisExtensions

This interface represents the extensions polaris adds to the clients' response. It contains the data version of the data service, and the irrelevant entities on the request that was sent.

PolarisGraphQLRequest

This interface represents all relevant data of the request. It contains query, variables, and operation name.

PolarisWarning

This interface represents the warnings you can add to the request. A warning contains a message and its path.

PolarisGraphQLContext

This interface wraps PolarisBaseContext and adds the client's request, and the response, returned extensions, errors and warnings received from the data service specific to that request.

ApplicationProperties

This interface represents your application properties. It contains:

  • id (string - Optional) - the id of the application.
  • name (string - Optional) - the name of the application.
  • version (string - Optional) - current version of the application.
  • environment (string - Optional) - the environment you are running your application on.
  • component (string - Optional) - name of your part in your system.

Common Methods

runAndMeasureTime - gets runnable, returns an object which contains the time it took to run the runnable in milliseconds and its response.

Package Sidebar

Install

npm i @enigmatis/polaris-common

Weekly Downloads

5

Version

1.4.5

License

ISC

Unpacked Size

57.6 kB

Total Files

64

Last publish

Collaborators

  • yarinvak
  • osher-sade
  • drvoid
  • ron-katz
  • enigmatis324