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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gzmjs/console-remote

v1.0.0

Published

GZMJS Console Remote Client

Readme

控制台远程服务

简介

控制台远程服务,属于 GZMJS 项目的控制台模块。

版本

当前版本:0.1.4

包名

@gzmjs/console-remote

功能特性

  • 提供 GraphQL API 客户端
  • WebSocket 订阅支持
  • 多租户管理
  • 与 GZMJS 生态系统无缝集成

安装

pnpm add @gzmjs/console-remote

使用方法

核心功能模块

1. 配置管理 (config)

提供远程服务配置功能:

  • setConfig() - 设置远程配置
  • getGraphQLUrl() - 获取 GraphQL URL
  • getIconUrl() - 获取图标 URL
  • getUploadUrl() - 获取上传 URL
  • getDownloadUrl() - 获取下载 URL

示例:

import { setConfig, getGraphQLUrl } from '@gzmjs/console-remote';

// 配置远程服务
setConfig({
  graphqlEndpoint: '/api/graphql'
});

// 获取 GraphQL URL
const url = getGraphQLUrl();

2. GraphQL 通信 (graphQL)

提供 GraphQL 查询和订阅功能:

  • GraphError - GraphQL 错误类
  • postGraph<T>() - 发送 GraphQL POST 请求
  • subscribeGraph<T>() - 创建 GraphQL 订阅

示例:

import { postGraph } from '@gzmjs/console-remote';

// 执行 GraphQL 查询
const result = await postGraph<MyType>(`
  query {
    getApp(id: "123") {
      name
      icon
    }
  }
`);

3. 表单处理 (form)

提供 GraphQL 表单创建功能:

  • createGraphQLForm() - 创建 GraphQL 表单
  • createHiddenForRVT() - 创建隐藏输入字段
  • downloadGraph() - 下载 GraphQL 结果

4. 图标处理 (icon)

提供图标 URL 生成功能:

  • getIcon16Url() - 获取 16x16 图标 URL
  • getIcon32Url() - 获取 32x32 图标 URL

5. 租户管理 (tenant)

提供多租户支持:

  • getTenants() - 获取租户列表
  • AppModuleTenants - 应用模块租户类
  • tryGetCurrentTenant() - 获取当前租户
  • getAppModuleIdFromQueryId() - 从查询 ID 获取应用模块 ID
  • saveCurrentTenant() - 保存当前租户

6. 类型查询 (type)

提供 GraphQL 类型查询功能:

  • EnumValues - 枚举值类型
  • TypeFields - 类型字段类型
  • GraphQLType - GraphQL 类型
  • getGraphQLType() - 获取 GraphQL 类型定义
  • getEnumValues() - 获取枚举值
  • getEnumObj() - 获取枚举对象

依赖关系

本包依赖以下模块:

  • graphql-ws (^6.0.7)
  • @gzmjs/console-types (workspace:*)

构建

pnpm run build

许可证

本项目采用 ISC 许可证。