@cspeach/sap-client

中文文档
0.1.35发布于 2026/11/05SEE LICENSE IN LICENSETypeScriptES Module近 30 天下载 2893

SAP development client used by CSPeach. Write/activate lifecycle, TLS for self-signed certs, snapshot + audit hooks.

原始使用文档
文档目录5 节
  1. Features
  2. Installation
  3. Quick start
  4. API surface
  5. License

@cspeach/sap-client

SAP development client with safe write/activate lifecycle. Used by CSPeach — AI-powered ABAP development.

Status: v0.1.0 — first public release on npm (2026-05-13). Proprietary; see LICENSE for terms. Free to use under your active CSPeach plan; not free to redistribute or fork. See DECISIONS.md for the design boundary against cspeach-cli.

Features

  • Full SAP REST coverage: programs, classes, interfaces, CDS views, behavior definitions, service definitions/bindings, tables, message classes, transports.
  • Proper lock → PUT → unlock lifecycle with 423 recovery.
  • HTTP/1.1 forced. TLS verification ON by default — trust a customer's internal/corporate CA via caCertPath/caCert (verification stays on); explicit dev-only insecureSkipTlsVerify disables it with a loud warning. Legacy sslVerify: false is still accepted (mapped to insecure + warns).
  • Request serialization via a per-connection mutex (prevents cookie/CSRF races).
  • Snapshot + audit-log hooks built in; opt into them via the safety/ exports.

Installation

npm install @cspeach/sap-client

Used internally by @cspeach/cli. Direct dependency only if you're building tooling against SAP REST and want the lock/write/unlock lifecycle.

Requires Node.js 20+.

Quick start

import { SapConnection, AdtClient } from '@cspeach/sap-client';

// Constructor takes 3 positional args: (config, username, password)
const conn = new SapConnection(
  {
    host: '172.16.24.98',
    port: 44300,
    client: '100',
    useSsl: true,
    // TLS verification is ON by default. For self-signed / internal-CA SAP
    // systems, trust the CA instead of disabling verification:
    caCertPath: '/etc/ssl/corp-ca.pem',   // adds the CA, keeps verification ON
    // Dev-only escape hatch (NEVER production) — disables verification and
    // logs a loud warning on connect:
    // insecureSkipTlsVerify: true,
    credentialRef: 'my-sap-alias',
    authType: 'basic',
  },
  'S.LAEEQ',
  process.env.SAP_PASSWORD!,
);

const adt = new AdtClient(conn);
// getSource takes (type, name) — type first
const source = await adt.getSource('CLAS', 'ZCL_FOO');
console.log(source);

API surface

See the index.ts exports. Core classes:

  • SapConnection — low-level SAP REST HTTPS transport
  • AdtClient — high-level operations: getSource, setSource, activate, lock, unlock, atcRun, transport management, etc.

Safety modules:

  • snapshots — take/restore source snapshots before writes
  • auditLog — append-only operation log
  • rollback — restore a named object to a snapshot state

License

Proprietary. Copyright (c) 2026 Cremencing Solutions. All rights reserved. Free to use under your active CSPeach plan; not free to redistribute, fork, or sublicense. Commercial / OEM licensing: [email protected].

版本与发布记录

@cspeach/sap-client 共发布 36 个版本,首次发布于 2026/05/14;过去 12 个月发布了 36 个版本。

版本发布日期距今
0.1.35latest2026/11/055 天前
0.1.342026/11/056 天前
0.1.332026/11/056 天前
0.1.322026/11/038 天前
0.1.312026/10/2714 天前
0.1.302026/10/2319 天前

关于 @cspeach/sap-client 的常见问题

@cspeach/sap-client 是什么?

SAP development client used by CSPeach. Write/activate lifecycle, TLS for self-signed certs, snapshot + audit hooks.

如何安装 @cspeach/sap-client?

在项目目录运行 npm install @cspeach/sap-client,或使用 pnpm add / yarn add / bun add。

@cspeach/sap-client 支持 TypeScript 吗?

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

@cspeach/sap-client 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cspeach/sap-client 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cspeach/sap-client 可以商用吗?

@cspeach/sap-client 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@cspeach/sap-client 的下载量有多少?

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

@cspeach/sap-client 还在维护吗?

最新版本 0.1.35 发布于 2026/11/05(5 天前);至今共发布 36 个版本,其中过去 12 个月发布了 36 个;首次发布于 2026/05/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。