Git Product home page Git Product logo

ois's Introduction

@api3/ois

OIS (or Oracle Integration Specifications) is a JSON object that describes an API specification

You can find the documentation for OIS in the docs.

Installation

To install this package run either:

pnpm add @api3/ois

or if you use npm:

npm install @api3/ois --save

Gotchas

Use pinned version

We recommend using a pinned version of the OIS package because the validation included in the package enforces the OIS version up to the patch. Pinning the version also ensures your project uses the correct OIS version even if there are other packages depending on a different OIS version.

Make sure only one "zod" version is installed

Internally, we use zod to implement validation and TS typing for the OIS schema. It's possible to have TS issues when multiple different zod versions are used in a project.

Usage

The OIS package defines validation and TypeScript typings that can be used to verify correctness of a full OIS schema or just a part of it. For example:

const { oisSchema } = require('@api3/ois');

const possibleOis = {
  // Placeholder values. Refer to the Example section below and the documentation.
  oisFormat: '1.0.0',
  version: '1.2.3',
  title: 'coinlayer',
  apiSpecifications: { ... } // omitted for brevity
  endpoints: [ ... ], // omitted for brevity
};
const result = oisSchema.safeParse(possibleOis);
if (!result.success) {
  throw result.error
} else {
  const validOis = result.data
}

Example

An example of a valid OIS can be found here.

Developer documentation

Release

To release a new version follow these steps:

  1. git checkout main && git pull - ensure you are on a "main" branch with latest changes
  2. pnpm version x.y.z - where x.y.z is the version to be released
  3. git show - verify the changes of the version commit
  4. pnpm build - only build the package after the "pnpm version" command so the bundled "package.json" uses the updated version
  5. pnpm publish --access public
  6. git push --follow-tags - to push the commits to a "main" branch

ois's People

Contributors

dependabot[bot] avatar dcroote avatar aquarat avatar metobom avatar siegrift avatar github-actions[bot] avatar andreogle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.