# @commercetools/cli-topic-integration-layer 中文文档

规范地址：https://npmcn.com/package/%40commercetools/cli-topic-integration-layer/

版本：1\.3\.1
npm 元数据更新时间：2026-10-15T13:29:57.981Z
中文译文更新时间：2026-11-10T12:12:19.600Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40commercetools/cli-topic-integration-layer
原文对照：https://npmcn.com/package/%40commercetools/cli-topic-integration-layer/?lang=original
项目主页：https://github.com/commercetools/commerce-integration-layer-extensions#readme
源码仓库：https://github.com/commercetools/commerce-integration-layer-extensions

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：811 kB，217 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：12 个
- 首次发布：2026-07-27T10:16:17.146Z
- 最新版本发布：2026-10-15T13:29:57.611Z
- 近 30 天下载量：4154（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：19（近 12 个月 19 个）

## 中文简介

商务工具 CLI 插件: 集成层主题

## 安装

```sh
npm install @commercetools/cli-topic-integration-layer
```

也可以使用：`pnpm add @commercetools/cli-topic-integration-layer`、`yarn add @commercetools/cli-topic-integration-layer`、`bun add @commercetools/cli-topic-integration-layer`

## README

# @commercialtools/cli-topic-integration-layer (中文(简体) )

A 类 [商业工具](https://github.com/commercetools/cli) 添加插件的插件 `integration-layer` 主题——用于作者、运行、验证、出版、, 检查 [商业一体化层](https://docs.commercetools.com/commerce-integration-layer) 扩展.

它向公众npm注册处发布,并作为运行时间oclif按需安装 插件; 它从未被捆绑到底部 `@commercetools/cli`。 。 。 .

## 安装

```bash
npm install -g @commercetools/cli

# Opt in to the integration-layer topic (public npm — no auth needed)
commercetools plugins install @commercetools/cli-topic-integration-layer

# Log in once — mints the manage_project token the authenticated commands reuse
commercetools auth login --project-key <your-project-key>
```

## 图标

```bash
commercetools integration-layer init [DIR]                  # scaffold an extensions monorepo [offline]

commercetools integration-layer extension build             # bundle src/extension.ts → dist [offline]
commercetools integration-layer extension serve             # local dev server; allowlist-gated fetch when online + logged in
commercetools integration-layer extension invoke-api-extension   # fire an API-Extension callback at the local bundle [offline], or --deployed via the IL

commercetools integration-layer explore                     # local GraphQL explorer over your deployed edge
commercetools integration-layer schema fetch                # the Project's core-subgraph SDL

commercetools integration-layer config list|get|set|unset   # per-project extension configuration

commercetools integration-layer allowlist list|add|remove|set   # hosts the extension's fetch may reach

commercetools integration-layer project-settings get|set          # project label, language, currency, country

commercetools integration-layer idp-login get|set|delete          # external OpenID Connect IdP for shopper login

commercetools integration-layer checkout-rules get|add|remove|set   # which Checkout Application serves which shopper

commercetools integration-layer field-visibility list|hide|show|set   # custom fields hidden from the public API

commercetools integration-layer --version                   # the installed plugin version [offline]
```

添加 `--all` 改为 `build` 编号 : `serve` 编号 : `validate` 编号 : `push` 合并到 `./extensions/*` 输入一个项目部署的组合.

认证的命令显示从 `commercetools auth login` 联合国 `manage_project` 从您的登录中获取商业集成层的主机 地区; `--integration-layer-url` 编号 : `INTEGRATION_LAYER_URL` 覆盖扩展名 边缘.

**[充分参考——每个命令、旗帜、主机和CI的使用](https://github.com/commercetools/commerce-integration-layer-extensions/blob/main/docs/cli.md)** 财务报告和审定财务报表 [扩展授权细节](https://github.com/commercetools/commerce-integration-layer-extensions/blob/main/docs/authoring.md) 住在这里 [商业一体化层扩展](https://github.com/commercetools/commerce-integration-layer-extensions) 存储器,它也持有可随时编辑 每个图案的模板.

## 开发

这个包裹住在 [商业一体化层扩展](https://github.com/commercetools/commerce-integration-layer-extensions) 复发. 从回波 根数 :

```bash
pnpm install
pnpm --filter @commercetools/cli-topic-integration-layer build       # tsc → dist/
pnpm --filter @commercetools/cli-topic-integration-layer test        # vitest
pnpm typecheck
pnpm lint

pnpm setup:cli    # build + `commercetools plugins link` this checkout
```

更改插件吗 ? 添加更改列表( R)`pnpm changeset`在你的公关里.. [开发插件](https://github.com/commercetools/commerce-integration-layer-extensions/blob/main/docs/cli.md#developing-the-plugin) 释放流.

## 常见问题

### @commercetools/cli-topic-integration-layer 是什么？

商务工具 CLI 插件: 集成层主题

### 如何安装 @commercetools/cli-topic-integration-layer？

在项目目录运行 npm install @commercetools/cli-topic-integration-layer，或使用 pnpm add / yarn add / bun add。

### @commercetools/cli-topic-integration-layer 支持 TypeScript 吗？

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

### @commercetools/cli-topic-integration-layer 支持 ESM 还是 CommonJS？

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

### @commercetools/cli-topic-integration-layer 可以商用吗？

@commercetools/cli-topic-integration-layer 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @commercetools/cli-topic-integration-layer 的下载量有多少？

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

### @commercetools/cli-topic-integration-layer 还在维护吗？

最新版本 1\.3\.1 发布于 2026/10/15（25 天前）；至今共发布 19 个版本，其中过去 12 个月发布了 19 个；首次发布于 2026/07/27。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

