@hcmai/sdk
The TypeScript SDK behind the HCM Next CLI. It provides authenticated access to HCM business models, Actions, metadata, tenant workspaces, and AI conversations.
Install
npm install @hcmai/sdk
import { HcmClient } from '@hcmai/sdk';
Node.js 22 or newer is required. Source, merge requests, CI, and version tags are maintained in GitLab. Public npm installation does not require GitLab access. The team GitLab NPM registry receives the same release tarballs.
安装包数据 fixture v1
hcm import and parseFixture share the versioned, JSON-serializable
DATA_PACKAGE_FIXTURE_SCHEMA_V1 export (urn:hcmai:data-package-fixture:v1).
Its canonical declaration is key_field: code, identifying one real business key.
The legacy key: [code] declaration is accepted with a deprecation warning in the
parsed fixture, import result, and CLI stderr. Composite keys and simultaneous
key / key_field declarations are rejected before any request is sent.
完整安装包 manifest 使用服务端安装器的 models[].keys 与 extensions: 契约;
packDataPackage 返回 strippedDefinitionIds 和 bareUuidCount,DataPackage API 标识保持不变。
import { DATA_PACKAGE_FIXTURE_SCHEMA_V1, parseFixture } from '@hcmai/sdk';
const fixture = parseFixture(JSON.stringify(DATA_PACKAGE_FIXTURE_SCHEMA_V1.examples[0]));
// Surface fixture.warnings and runImport(...).warnings to SDK callers.