npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@omnsight/clients

v1.0.11

Published

TypeScript clients for Omniscent services

Readme

@omniscent/clients

这是为以下 Omniscent 服务自动生成的 TypeScript 客户端包:

  1. Omniauth
  2. Omndapi

目录结构

/src
  /omniauth       # Omniauth 服务的 TypeScript 客户端
  /omndapi        # Omndapi 服务的 TypeScript 客户端
/scripts
  generate-clients.js  # 生成客户端的脚本

安装和使用

作为依赖安装

npm install @omniscent/clients

手动生成客户端

npm login
npm run generate
npm run build
npm publish

该命令会:

  1. 从每个服务的 GitHub 仓库下载最新的 api.swagger.json 文件
  2. 使用 swagger-typescript-api 工具生成对应的 TypeScript 客户端
  3. 将生成的客户端保存在 /src 目录下

自动更新

该项目配置了 GitHub Action,每天自动运行一次客户端生成任务,确保客户端与最新的 API 保持同步。

在项目中使用

使用示例

生成的客户端不仅包含接口类型定义,还包含完整的 HTTP 客户端实现。以下是如何使用它的示例:

import { omniauth } from '@omniscent/clients';

// 创建 API 实例
const api = new omniauth.Api({
  baseURL: 'https://api.example.com',
  // 可以添加其他 axios 配置
});

// 调用 API 方法
const userData = await api.users.getUserById('user123');
console.log(userData);

或者直接导入特定的服务客户端:

import { Api } from '@omniscent/clients/src/omniauth/omniauth';

// 创建 API 实例
const api = new Api({
  baseURL: 'https://api.example.com'
});

开发

安装依赖:

npm install @omnsight/clients

运行生成脚本:

npm run build