1.0.2 • Published 2 years ago

@mintlify/mojito v1.0.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Mojito :cocktail:

contributions welcome

Mojito is Mintlify's OpenApi Specification gRPC Service.

Summary

Contains a proto service defnition for an OpenApiSpec repository service and integration testsuites to test the gRPC server and client.

Implementations:

:heavy_check_mark: go server

:heavy_check_mark: go client

:heavy_check_mark: node client

Consuming Mojito

If you just want to consume Mojito from node, install @mintlify/mojito.

  • Install the package:

yarn install @mintlify/mojito

  • Import the client and use the service methods.

The client takes options as a parameter and is Configurable by environment variables or options:

  • Token is configurable by the env variable MOJITO_TOKEN.
  • Endpoint is configurable by the env variable MOJITO_ENDPOINT.

Option fields override env variables.

import Mojito, { OpenApiSpecResponse } from "@mintlify/mojito";

export const mojitoClient = Mojito.default({
  ssl: true,
  token: { TOKEN },
  host: { HOST },
});

const res: OpenApiSpecResponse[] = [];
// Get an asyncIiterable response stream.
for await (const spec of mojitoClient.getOpenApiSpecs({
  values: [
    {
      subdomain,
    },
  ],
})) {
  // Iterate through the responses as they are received.
  res.add(spec);
}

Congratulations! You are now consuming mojito :cocktail:

Contributing to Mojito

Check out the Contributing section, if you want to mix some Mojito :herb: :snowflake: :lemon: :gem:

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.7.0-dev.6

2 years ago

0.7.0-dev.5

2 years ago

0.7.0-dev.4

2 years ago

0.7.0-dev.3

2 years ago