1.0.3 ā€¢ Published 1 year ago

@tws-js/client v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

TWS - Type-Safe Web Server Client

Test NPM

āœ… 100% code coverage

Usage

Install the package:

npm install @tws-js/client

Generate the types passing the URL of a TWS server schema:

npx tws-types --server http://localhost:3000/tws/schema --output server-types.ts

Finally use the generated types in your client code:

import { TwsClient } from '@tws-js/client';
import { TwsTypes } from './server-types';

const client = new TwsClient<TwsTypes>({
  // The URL of your TWS server. Also works with remote servers.
  url: 'http://localhost:3000/tws',
});

// Response and input types are automatically inferred
const response = await client.execute('myOperation', {
  name: 'TWS',
});

Collaborating

Setup

nvm use 18
npm install

Building

npm run build

Testing

npm run lint
npm test
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago