# @deliverart/sdk-js-integration 中文文档

规范地址：https://npmcn.com/package/%40deliverart/sdk-js-integration/

版本：3\.0\.1
npm 元数据更新时间：2026-11-10T20:27:27.575Z
中文译文更新时间：2026-11-12T02:41:20.102Z
软件包许可：未声明

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

原始 npm 页面：https://www.npmjs.com/package/%40deliverart/sdk-js-integration
原文对照：https://npmcn.com/package/%40deliverart/sdk-js-integration/?lang=original

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

- 包体积（解压后）：11.6 MB，6 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：11 个
- 首次发布：2025-07-06T15:18:38.027Z
- 最新版本发布：2026-11-10T20:27:27.393Z
- 近 30 天下载量：3185（2026-10-12 至 2026-11-10，npm 官方下载统计）
- 已发布版本数：317（近 12 个月 232 个）

## 中文简介

集成管理交付JavaScript SDK

## 安装

```sh
npm install @deliverart/sdk-js-integration
```

也可以使用：`pnpm add @deliverart/sdk-js-integration`、`yarn add @deliverart/sdk-js-integration`、`bun add @deliverart/sdk-js-integration`

## README

# @ deliverart/ sdk- js- 整合

交付艺术JavaScript SDK的集成管理软件包.

Tilby 集成读取并更新曝光 `syncSettings.respectDeliverartChannel` (默认) `true`和 `syncSettings.removeProductsWithoutDeliverartChannel` (默认) `false`) (中文(简体) ). 保存更改会影响以后的webhoks和下一次全同步; 它从来没有开始一个完全同步。 产品映射显示无效 `deliverartChannelAssigned` 观察,独立于当地销售渠道.

## 安装

```bash
npm install @deliverart/sdk-js-integration @deliverart/sdk-js-core
```

## 导出类型

### 核心类型

-   `Integration` - 一体化配置
-   `ActivatableIntegration` - 可激活/失效的整合
-   `IntegrationActivationRequest` - 请求启动整合
-   `IntegrationCancellationRequest` - 要求取消合并

### 整合类型

一体化类型因服务而异(交付伙伴、支付网关等)

电子商务信息有效载荷曝光了缓存菜单DTO. 项目包括 `compositions`,可移动基成份/成份的id作为 可写命令项目 `removals`。 。 。 . 公共电子商务菜单项目也曝光 `images` 与现有的图像合同 和产生的变种。 遗留响应中缺少的图像默认为空 列表中选择一个选项. `showProductImages` 默认为 `true` 关于公共信息和融合的内容; 它可以通过 `UpdateIntegrationEcommerce`明确 `false` 隐藏 编辑版式和网格版式中的产品相片;紧凑菜单仍只使用文字. PATCH 验证不会将外观默认输入不相关的更新. 这也暴露了POS `currency` 两个顶级电子商务信息有效载荷 财务报告和审定财务报表 `pointOfSale`,所以存储前置可以格式化菜单价格,总计,支付 概要和顺序历史,不假定欧元.

### IRI 类型

-   `IntegrationIri` - 融合国际研究所(IRI)`/integrations/:id`(中文(简体) )
-   `ActivationRequestIri` - 启动请求
-   `CancellationRequestIri` - 取消请求IRI

## 可用请求

### 获取集成

获取可用的整合列表 .

```typescript
import { GetIntegrations } from '@deliverart/sdk-js-integration'

const integrations = await sdk.call(
  new GetIntegrations({
    query: {
      company: '/companies/123',
      type: 'DELIVERY',
    },
  }),
)
```

* * *

### 获取集成细节

获取整合的详细信息.

```typescript
import { GetIntegrationDetails } from '@deliverart/sdk-js-integration'

const integration = await sdk.call(new GetIntegrationDetails('integration-123'))
```

* * *

### 综合业务问题

一体化问题暴露出一个供货商中立的工作流程,以应对业务异常。 问题包括: 其流量范围、严重程度、状态、远程资源密钥、连续失败计数、运算符 承认、解决和最后成功执行.

```typescript
import {
  AcknowledgeIntegrationIssue,
  GetAdminIntegrationIssues,
  ResolveIntegrationIssue,
} from '@deliverart/sdk-js-integration'

const issues = await sdk.call(
  new GetAdminIntegrationIssues({
    query: {
      service: ['deliveroo', 'glovo'],
      status: 'attention_required',
      severity: ['error', 'critical'],
      'resolvedAt[exists]': false,
      page: 1,
    },
  }),
)

await sdk.call(new AcknowledgeIntegrationIssue('integration-id', 'issue-id'))
await sdk.call(new ResolveIntegrationIssue('integration-id', 'issue-id'))
```

两个工作流程动作都发出空 `application/merge-patch+json` 请求。 标注 `/integration_issues` 收藏保留给集成管理员; 现有 `/integrations/{id}/issues` 收藏仍可供综合范围查看.

* * *

### 厨房会话处理

为厨房的整合创建一个短寿命的单用交接码,然后用它交换 已有的厨房访问脚本细节 。 这样可以让一个授权的Hub会话打开 KDS 不包含 在浏览器 URL 中设置一个持久的厨房令牌 .

```typescript
import {
  CreateIntegrationKitchenSessionHandoff,
  ExchangeIntegrationKitchenSessionHandoff,
} from '@deliverart/sdk-js-integration'

const handoff = await hubSdk.call(
  new CreateIntegrationKitchenSessionHandoff('kitchen-integration-id'),
)

const kitchenAccessToken = await kdsSdk.call(
  new ExchangeIntegrationKitchenSessionHandoff({ code: handoff.code }),
)
```

* * *

### 激活集成

请求启动整合.

```typescript
import { ActivateIntegration } from '@deliverart/sdk-js-integration'

const activation = await sdk.call(
  new ActivateIntegration({
    integration: '/integrations/123',
    pointOfSale: '/point_of_sales/456',
    config: {
      apiKey: 'your-api-key',
      // ... integration-specific config
    },
  }),
)
```

* * *

### 取消合并

请求取消活动整合.

```typescript
import { CancelIntegration } from '@deliverart/sdk-js-integration'

const cancellation = await sdk.call(
  new CancelIntegration({
    integration: '/integrations/123',
    reason: 'No longer needed',
  }),
)
```

* * *

### 交付奥手端口激活

交付一体化暴露 `manualActivationCompleted` 财务报告和审定财务报表 `manualActivationCompletedAt` 因此操作工具可以跟踪最终的人工激活步骤是否在"交付"门户网站上完成.

```typescript
import {
  GetIntegrationDeliverooList,
  UpdateIntegrationDeliveroo,
} from '@deliverart/sdk-js-integration'

const pending = await sdk.call(
  new GetIntegrationDeliverooList({
    query: {
      manualActivationCompleted: false,
    },
  }),
)

await sdk.call(
  new UpdateIntegrationDeliveroo('deliveroo-integration-id', {
    manualActivationCompleted: true,
  }),
)
```

* * *

### CassaInCloud Catalog 频道政策

CassaInCloud 揭露了单独的远程频道政策:

-   `inboundProductChannels` 过滤卡萨类别和进口到Abelart的产品.
-   `outboundProductChannels` 当 交付 创建远程 Cassa 时 被捕获并应用 类别和产品.
-   `productChannels` 是一个被折旧的别名,用于 `inboundProductChannels` 并且仍然可用 只释放一个相容性.

通过嵌入式API平台同步进行审计和明确通道调节 `catalog_mapping_processes` 资源。 程序保留其操作、范围、目标 频道快照、柜台和打出的问题.

```typescript
import {
  CreateIntegrationCassaInCloudCatalogMappingProcess,
  GetIntegrationCassaInCloudCatalogMappingProcessIssues,
  GetIntegrationCassaInCloudCatalogMappingProcessDetails,
  GetIntegrationCassaInCloudCatalogMappingProcesses,
  RetryIntegrationCassaInCloudCatalogMappingProcess,
} from '@deliverart/sdk-js-integration'

const process = await sdk.call(
  new CreateIntegrationCassaInCloudCatalogMappingProcess('integration-id', {
    operation: 'reconcile_channels',
    scopes: ['categories', 'products'],
  }),
)

const details = await sdk.call(
  new GetIntegrationCassaInCloudCatalogMappingProcessDetails('integration-id', process.id),
)

const history = await sdk.call(
  new GetIntegrationCassaInCloudCatalogMappingProcesses('integration-id', {
    query: { operation: 'audit', 'order[createdAt]': 'desc' },
  }),
)

const issues = await sdk.call(
  new GetIntegrationCassaInCloudCatalogMappingProcessIssues('integration-id', process.id, {
    query: { retryable: true },
  }),
)

const retry = await sdk.call(
  new RetryIntegrationCassaInCloudCatalogMappingProcess('integration-id', process.id),
)
```

* * *

### 大象融合组织

大象每发售点使用一个集成点和一个或多个筑巢餐厅 成员资格。 首先创建整合,然后提供每个餐厅及其 交付可选销售模式、要求的倒置类别、目录渠道、订单 类型、准备时间和接收超时。 设定 `salesMode` 改为 `null` 要使用基数 目录价格.

启动要求和牵头合同被接受 `service: 'elephant'` 同样的 `integrationElephantDataSchema` 载荷。 这包括创建、细节、更新/答复, 和HUB和行政部门使用的所有响应计划.

```typescript
import {
  CreateIntegrationElephantRestaurantMapping,
  CreateIntegrationElephant,
  CreateIntegrationElephantRestaurant,
  GetIntegrationElephantCatalogImportProcessDetails,
  GetIntegrationElephantCatalogImportProcesses,
  GetIntegrationElephantOrderReleases,
  GetIntegrationElephantRestaurantCatalogProducts,
  GetIntegrationElephantRestaurantMappings,
  GetIntegrationElephantRestaurants,
  GetIntegrationRequestLogs,
  RefreshIntegrationElephantRestaurantCatalog,
  RetryIntegrationElephantProvisioning,
  StartIntegrationElephantCatalogImport,
  UpdateIntegrationElephant,
  UpdateIntegrationElephantRestaurant,
} from '@deliverart/sdk-js-integration'

const integration = await sdk.call(
  new CreateIntegrationElephant({
    pointOfSale: '/point_of_sales/8a745a0b-a68b-4f98-87ca-74df04a3bfe3',
    credentialMode: 'managed',
  }),
)

const restaurant = await sdk.call(
  new CreateIntegrationElephantRestaurant(integration.id, {
    name: 'Restaurant Centre',
    platform: 'migros_yemek',
    platformRestaurantId: 'restaurant-123',
    platformChainId: 'group-456',
    authentication: {
      secret_key: '12345678901234567890123456789012',
      x_api_key: 'write-only-platform-key',
      store_id: 'restaurant-123',
      store_group_id: 'group-456',
    },
    salesMode: null,
    category: '/menu_item_categories/20c71a6a-c924-42e0-9078-e3f672704dbb',
    defaultTaxRate: 10,
    channels: ['application', 'elephant'],
    orderType: 'delivery',
    defaultPreparationTime: 15,
    acceptanceTimeout: 5,
  }),
)

await sdk.call(
  new UpdateIntegrationElephant(integration.id, {
    defaultRestaurantMembership: `/integrations/elephant/${integration.id}/restaurants/${restaurant.id}`,
  }),
)

await sdk.call(
  new UpdateIntegrationElephantRestaurant(integration.id, restaurant.id, {
    acceptanceTimeout: 10,
  }),
)

const staleRestaurants = await sdk.call(
  new GetIntegrationElephantRestaurants(integration.id, {
    query: {
      catalogStatus: 'stale',
      status: ['active', 'paused'],
      'order[name]': 'asc',
    },
  }),
)

await sdk.call(new RetryIntegrationElephantProvisioning(integration.id))
await sdk.call(new RefreshIntegrationElephantRestaurantCatalog(integration.id, restaurant.id))

const catalogImport = await sdk.call(
  new StartIntegrationElephantCatalogImport(integration.id, restaurant.id),
)
const catalogImportDetails = await sdk.call(
  new GetIntegrationElephantCatalogImportProcessDetails(
    integration.id,
    restaurant.id,
    catalogImport.id,
  ),
)

const platformProducts = await sdk.call(
  new GetIntegrationElephantRestaurantCatalogProducts(integration.id, restaurant.id, {
    query: { q: 'pizza', page: 1 },
  }),
)
const mappings = await sdk.call(
  new GetIntegrationElephantRestaurantMappings(integration.id, restaurant.id, {
    query: { role: 'product', page: 1 },
  }),
)

await sdk.call(
  new CreateIntegrationElephantRestaurantMapping(integration.id, restaurant.id, {
    role: 'product',
    platformReference: platformProducts.data[0].platformReference!,
    platformGroupReference: null,
    appMenuItemId: 'deliverart-menu-item-id',
    appModifierId: null,
    appVariantId: null,
    appSalesModeId: null,
  }),
)

const releases = await sdk.call(
  new GetIntegrationElephantOrderReleases(integration.id, {
    query: { status: ['preparing', 'failed'], page: 1 },
  }),
)
const requestLogs = await sdk.call(
  new GetIntegrationRequestLogs(integration.id, {
    query: { outcome: 'server_error', page: 1 },
  }),
)
```

使用 `credentialMode: 'provided'` 只有在将现有大象房客和 应用; `tenantId`, (中文(简体) ), `appId`,以及 `personalAccessToken` 然后,所有的要求。 餐厅 认证只写 。 取消餐馆会员资格开始同步 `removing` 生命周期; 大象集成本身并不暴露直接的 DELETE 操作.

以下请求类涵盖当前 API 表面 :

-   `GetIntegrationElephantList`, (中文(简体) ), `GetIntegrationElephantDetails`
-   `CreateIntegrationElephant`, (中文(简体) ), `UpdateIntegrationElephant`
-   `GetIntegrationElephantRestaurants`, (中文(简体) ), `GetIntegrationElephantRestaurantDetails`
-   `CreateIntegrationElephantRestaurant`, (中文(简体) ), `UpdateIntegrationElephantRestaurant`
-   `DeleteIntegrationElephantRestaurant`
-   `RetryIntegrationElephantProvisioning`, (中文(简体) ), `TestIntegrationElephantConnection`, (中文(简体) ), `ReconcileIntegrationElephant`
-   `RetryIntegrationElephantRestaurantProvisioning`, (中文(简体) ), `TestIntegrationElephantRestaurantConnection`, (中文(简体) ), `RefreshIntegrationElephantRestaurantCatalog`, (中文(简体) ), `PauseIntegrationElephantRestaurant`, (中文(简体) ), `ResumeIntegrationElephantRestaurant`
-   `GetIntegrationElephantRestaurantCatalogProducts`, (中文(简体) ), `GetIntegrationElephantRestaurantCatalogOptions`, (中文(简体) ), `GetIntegrationElephantRestaurantCatalogVariants`, (中文(简体) ), `GetIntegrationElephantRestaurantAppCatalogMirror`
-   `GetIntegrationElephantRestaurantMappings`, (中文(简体) ), `CreateIntegrationElephantRestaurantMapping`, (中文(简体) ), `DeleteIntegrationElephantRestaurantMapping`
-   `GetIntegrationElephantCatalogImportProcesses`, (中文(简体) ), `StartIntegrationElephantCatalogImport`, (中文(简体) ), `GetIntegrationElephantCatalogImportProcessDetails`
-   `GetIntegrationElephantOrderReleases`, (中文(简体) ), `GetIntegrationElephantOrderReleaseDetails`
-   `GetIntegrationRequestLogs`, (中文(简体) ), `GetIntegrationRequestLogDetails`

餐厅,目录,绘图,订单发布,以及请求日志集被标注. 输入目录的历史被故意解贴和支持状态、步骤、日期和 命令过滤器;每个餐厅会员只允许一个待进或正在运行的导入. 使用它们的导出查询类型, 而不是手动构建查询字符串 。 请求日志 是API的消毒诊断模型: 符号和有效载荷体被故意缺失.

* * *

## 完成使用示例

```typescript
import { sdk } from './lib/sdk'
import {
  GetIntegrations,
  ActivateIntegration,
  CancelIntegration,
} from '@deliverart/sdk-js-integration'

async function integrationManagement() {
  // Get available delivery integrations
  const integrations = await sdk.call(
    new GetIntegrations({
      query: {
        type: 'DELIVERY',
        company: '/companies/123',
      },
    }),
  )

  // Activate delivery partner
  const activation = await sdk.call(
    new ActivateIntegration({
      integration: integrations.data[0]['@id'],
      pointOfSale: '/point_of_sales/456',
      config: {
        apiKey: process.env.DELIVERY_API_KEY,
        webhookUrl: 'https://myapp.com/webhooks/delivery',
      },
    }),
  )

  // Cancel integration
  await sdk.call(
    new CancelIntegration({
      integration: activation.integration,
      reason: 'Switching to different provider',
    }),
  )
}
```

## 许可证

麻省理工学院

## CassaInCloud 命令生命周期决定

Webhook 策略曝光可选无效 `orderLifecycleOutcome` 财务报告和审定财务报表 `orderLifecycleRevision`。 。 。 . `amendment_review_required` 表示回电是 记录时不更改修改后的顺序;审查其目前在Hub的状态. 接受准备不是准备申请的证据。 历史无效/缺席 结果没有应用证据。 部署 API 迁移 `Version20260918060000` 在使用最新的工人和客户合同之前.

## Tilby 修正命令远程删除

`MappingSyncFailureCode.AMENDED_ORDER_REMOTE_DELETED` 序列化为 `amended_order_remote_deleted`在确认后,它伴随人工解析 远程删除受修正历史或邻居意图保护的命令. 克能克之令和还款史被保留. 客户必须说明 登记审查与更正完成或确认退款分开.

### 电子商务的出现

`theme` 支持 `primary`, (中文(简体) ), `accent`, (中文(简体) ), `background`, (中文(简体) ), `surface`, (中文(简体) ), `text`,以及 `muted` 六分颜色. `fontFamily` 财务报告和审定财务报表 `headingFontFamily` 从 `inter`, (中文(简体) ), `poppins`, (中文(简体) ), `nunito_sans`,以及 `playfair_display`现有一体化可能 省去新密钥; 公开信息解决默认以保存已存在的品牌. 这些设置也通过铅/活性数据出行. 字体 URL 和任意性 不支持字体名称。 现有2.37个主题通过,保留了 协调推出期间给消费者的添加键.

## 电子商务支付配置参考文献

`paymentConfigs` 使用特定方法的参考文献,例如: `/payment_configs/credit_card/<uuid>`。该方法是一个字面路由段;只有配置标识符是一个UUID。 SDK接受Cash,Credit Card,Bank Transfer,Frape和Ticket的引用,包括SDK对象被设置格式所串行,并拒绝不支持的方法或错误的标识. POS集成集成和电子商务设置使用相同的被验证的合同.

### 厨房客户可见度

厨房融合暴露 `showCustomerInfo` 财务报告和审定财务报表 `showCustomerAddress`。 。 。 . 两者默认为 `false` 在创建和分析旧的API反应时. 在启用地址前启用客户信息 。 隐藏所有客户 细节, 一起更新两个设置 :

```ts
await client.call(new UpdateIntegrationKitchen(integrationId, {
  showCustomerInfo: false,
  showCustomerAddress: false,
}))
```

Ocondent PATCH 设置被保留. 这些是 KDS 显示偏好和做 没有编辑命令 API 响应 。 更改后重新装入 KDS .

### Cassa 云全输入调节器调节

现有的全程输入菜单同步完成 `reconcile_modifiers`同步 进程显示可选 `modifierReconciliation` 载有 `status`, (中文(简体) ), `processed`, (中文(简体) ), `reconciled`,以及 `blocked`旧的答复省略了这个领域。 这个 活动工作流程位置为 `reconciling_modifiers`,并使用 已存在的菜单错误日志资源 `step=reconcile_modifiers`。 。 。 .

只有成功的完全导入才能建立完整而独特的信件 在同一映射产品上的等效重复组/选择之间。 这个 保存目录UUID,历史顺序内容,以及本地提供者绘图. 它不重试被封锁的订单;单独使用明确的订单交付回收.

卡萨国际云 `apiKey` 和蒂尔比 `apiToken` 是只写输入。 他们的阅读 模型剥去历史秘密字段并曝光可选 `apiKeyConfigured` 编号 : `apiTokenConfigured` 存在元数据。 缺少的元数据在 前端首次 API 推出; 不得通过保留返回来推断 暗号 完整/创建的写作仍需要证书; PATCH 可能会省略到 保存服务器自有值并拒绝明确的空白值。 Cassa 列表查询 不再接受 API 密钥。 这是一个破解的读取模式变化:更新和 在发布后端的只写合同前给所有客户端打针 .

CassaInCloud/Tilby 创建、更新和激活证书仅限于 32,768 UTF-8字节,匹配经认证的本地存储. 他们共享的 `providerCredentialSchema` 保留现有输入修饰/需要的诊断; 字节计数接受所有核准的多字节源代码长度,而不包含 截取取出. 直接保存捕获的字节 通过本地密码, 独立于人类的 SDK 输入清理.

## 常见问题

### @deliverart/sdk-js-integration 是什么？

集成管理交付JavaScript SDK

### 如何安装 @deliverart/sdk-js-integration？

在项目目录运行 npm install @deliverart/sdk-js-integration，或使用 pnpm add / yarn add / bun add。

### @deliverart/sdk-js-integration 支持 TypeScript 吗？

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

### @deliverart/sdk-js-integration 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @deliverart/sdk-js-integration 可以商用吗？

@deliverart/sdk-js-integration 使用 未声明 许可。package\.json 没有声明许可证。没有许可证的代码默认保留全部权利，商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括，不构成法律意见，请以许可原文为准。

### @deliverart/sdk-js-integration 的下载量有多少？

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

### @deliverart/sdk-js-integration 还在维护吗？

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

