@api3/ois

中文文档
3.0.0发布于 2025/07/28MITTypeScriptCommonJS构建来源已验证近 30 天下载 4928

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

原始使用文档
文档目录6 节
  1. Installation
  2. Gotchas
  3. Usage
  4. Example
  5. Developer documentation
  6. Release

@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

Releasing is facilitated by GitHub Actions using changesets/action. To release a new version follow these steps:

  1. Assuming desired changes are present on main with changesets, create a GitHub PR to the release branch from main.
  2. Merge the PR to release using a merge commit.
  3. The publish Action workflow will create a release PR.
  4. Review the release PR and merge it to release using squash and merge.
  5. The publish Action workflow will publish a GitHub release and publish the package to npm with provenance. It will also create a PR for merging the release branch back to main.
  6. Merge the PR to main from release using a merge commit.

Note that development can continue on main during the release process, or in other words, main does not need to be protected.

版本与发布记录

@api3/ois 共发布 16 个版本,首次发布于 2022/06/23;过去 12 个月发布了 0 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.0.0latest2025/07/281.3 年前
2.3.22024/02/042 年前
2.3.12023/11/302 年前
2.3.02023/11/272 年前
2.2.12023/10/063 年前
2.2.02023/09/273 年前

关于 @api3/ois 的常见问题

@api3/ois 是什么?

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

如何安装 @api3/ois?

在项目目录运行 npm install @api3/ois,或使用 pnpm add / yarn add / bun add。

@api3/ois 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@api3/ois 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@api3/ois 可以商用吗?

@api3/ois 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@api3/ois 的下载量有多少?

根据 npm 官方下载统计,@api3/ois 在 2026/10/06 – 2026/11/04 这 30 天内被下载 4,928 次,日均约 164 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@api3/ois 还在维护吗?

最新版本 3.0.0 发布于 2025/07/28(1.3 年前);至今共发布 16 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/06/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。