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

@xdmp-open/sdk-admin

v0.1.7

Published

XDMP platform admin SDK: passport and system APIs

Readme

@xdmp-open/sdk-admin

XDMP 平台管理端 SDK,覆盖 /api/passport 与 /api/system:登录、用户、角色、权限、字典、文件、LCDP Runtime。合计 139 个端点(passport 组 12 + system 组 127;已排除内部 /inner/ 路径、内部 user-details 端点,以及 springdoc 动态 Schema 演示端点)。Runtime resource 已生成,但可用门仍关闭,不得当作业务 Runtime 已可用。

兼容性

0.x 对齐 XDMP 平台 2.6.x。破坏性变更升 major。

安装

pnpm add @xdmp-open/sdk-admin

用法

本包是 @xdmp-open/sdk-core 之上的薄 resource 层。先创建核心请求引擎,再构造 admin 客户端:

import { createSdkClient } from '@xdmp-open/sdk-core'
import { createAdminClient } from '@xdmp-open/sdk-admin'

const client = createSdkClient({
  baseURL: '/',
  tokenProvider: myTokenProvider, // getAccessToken / getRefreshToken / setTokens / clear
  onUnauthorized: () => router.push('/login'),
})

const admin = createAdminClient(client)

// passport 组 —— /api + OpenAPI 路径(/passport/** 网关免登)
const captcha = await admin.passport.auth.captcha() // POST /api/passport/captcha(skipAuth)
const token = await admin.passport.auth.login({ username: 'alice', password: encrypted })
await admin.passport.auth.logout()

// system 组 —— /api/system + OpenAPI 路径
const page = await admin.system.user.page({ pageNo: 1, pageSize: 20, form: {} })
const user = await admin.system.user.query('alice') // GET /api/system/users/user/query/alice
await admin.system.role.assignAuthorities('admin', { authorityIds: ['1', '2'] })

// 文件上传/下载
const uploaded = await admin.system.binary.add(file, { name: 'a.txt', objectName: 'dir/a.txt' })
const { data, headers } = await admin.system.binary.download(uploaded.id)

// 导出(POST 下载)
const csv = await admin.system.depart.export({})

// LCDP Runtime(可用门仍关闭;Options 仍 fail-closed)
const columns = await admin.system.lcdpRuntime.getColumns('demo.form')

所有方法 resolve 拆包后的 CommonResponse.data,非成功业务码抛 SdkError。方法签名引用生成的 OpenAPI 类型,后端契约漂移会在编译期暴露。

资源一览

  • admin.passport:auth(验证码/登录/续签/登出/改密/公开配置)、social(社交登录/短信验证码/绑定)、user(修改密码)
  • admin.system:user、role、authority、depart、position、dict、category、client、binary、config、loginAudit、operateAudit、notice、notify、openApp、label、member、cache、job、jobExecutor、jobLog、lcdpRuntime

生成类型

src/generated/ 由后端 OpenAPI 导出(openapi/passport.json、openapi/system.json)经 openapi-typescript 生成。生成文件已入库 —— 不要手改;在仓库根执行 pnpm sync:openapi 刷新。