open-index/open-npm huggingface dataset:
npm package: @opvious/api
Description: API resources
Author: Opvious Engineering
Latest version: 0.25.7

# Opvious API

This package contains auto-generated SDKs and types for the
[Opvious](https://www.opvious.io) API. It is suitable for use both client-side
and server-side.


## Quickstart

```typescript
import {createSdk, createGraphqlSdk} from '@opvious/api';

// REST SDK (data operations)
const sdk = createSdk({
  // Optional authorization token
  headers: {authorization: `Bearer ${process.env.OPVIOUS_TOKEN}`},
});

// GraphQL SDK (metadata operations)
const graphqlSdk = createGraphqlSdk(sdk);
```

Note that several SDK methods require an API access token. You can generate one
[here](https://hub.cloud.opvious.io/authorizations).


## Included resources

This package also includes the following resource files:

+ OpenAPI specification (`resources/openapi.yaml`);
+ GraphQL schema (`resources/graphql/schema.gql`);
+ GraphQL operations (`resources/graphql/**/*.graphql`).

These can be used to generate your own SDKs.


## Related libraries

+ [Higher level TypeScript
  SDK](https://www.opvious.io/sdk.ts/modules/opvious.html), recommended if you
  are interfacing with the Opvious API from your backend
+ [Python SDK](https://opvious.readthedocs.io), recommended to formulate complex
  optimization models
npm package: @opvious/eslint-plugin
Description: Shared linting config
Author: Opvious Engineering
Latest version: 0.12.0

# ESLint plugin

Shared linting configuration.

## Quickstart

First, install ESLint and this plugin:

```sh
$ npm i -D eslint @opvious/eslint-plugin
```

Then reference this plugin in `.eslintrc.js`:

```js
module.exports = {
  plugins: ['@opvious'],
  extends: ['plugin:@opvious/typescript'], // One of the configurations below.
  // Project-specific configuration...
};
```

## Configurations

+ `typescript`, defaults for a TypeScript project. The corresponding parser is
  included in the plugin.
npm package: @opvious/prettier-typescript
Description: Shared prettier config for TypeScript
Author: Opvious Engineering
Latest version: 0.12.0

# Prettier TypeScript configuration

Shared prettier configuration for TypeScript projects.

## Quickstart

```sh
$ npm i @opvious/prettier-typescript
```

Then, inside `package.json`:

```json
{
 "prettier": "@opvious/prettier-typescript"
}
```

More information:
https://prettier.io/docs/en/configuration.html#sharing-configurations
npm package: @opvious/stl-errors
Description: Standard errors
Author: Opvious Engineering
Latest version: 0.27.3

# Standard errors

## Motivation

Good error handling is a prerequisite for good telemetry. To help with this,
`@opvious/stl-errors` provides a simple `StandardError` interface which exposes
powerful building blocks:

+ Namespaced error codes;
+ Causal chains;
+ Optional structured data.

## Quickstart

Standard errors are best created via `errorFactories` which provides type-safe
error creation functions along with their codes:

```typescript
import {errorFactories} from '@opvious/stl-errors';

const [errors, codes] = errorFactories({
  definitions: {
    invalidFoo: (foo: string) => ({
      message: `The input foo ${foo} was invalid`,
      tags: {foo},
    }),
    missingBar: 'The bar was missing',
  },
});

// Error with code `ERR_INVALID_FOO` (`codes.InvalidFoo`).
const err1 = errors.invalidFoo('fff');

// Error with code `ERR_MISSING_BAR` (`codes.MissingBar`).
const err2 = errors.missingBar();
```
npm package: @opvious/tsconfig
Description: Shared TypeScript config
Author: Opvious Engineering
Latest version: 0.12.0

# TypeScript configuration

Shared `tsconfig.json`, inspired by https://github.com/tsconfig/bases.

## Quickstart

```sh
$ npm i @opvious/tsconfig
```

Then, inside `tsconfig.json`:

```json
{
 "extends": "@opvious/tsconfig"
}
```