@deliverart/sdk-js-receipt-template

中文文档
3.0.1发布于 2026/11/11TypeScriptESM + CJS近 30 天下载 3191

Deliverart JavaScript SDK for versioned receipt templates

原始使用文档

@deliverart/sdk-js-receipt-template

Typed SDK contract for point-of-sale receipt templates.

The package provides:

  • Zod schemas for versioned block definitions;
  • list, detail, point-of-sale collection, create, and update requests;
  • optimistic concurrency through If-Match on UpdateReceiptTemplate;
  • IRI schemas for relationships from print rules.
import {
  GetReceiptTemplateDetails,
  UpdateReceiptTemplate,
} from '@deliverart/sdk-js-receipt-template'

const template = await sdk.call(new GetReceiptTemplateDetails(templateId))

const updated = await sdk.call(
  new UpdateReceiptTemplate(template.id, template.revision, {
    name: 'Cucina',
    definition: nextDefinition,
  }),
)

UpdateReceiptTemplate emits application/merge-patch+json and a strong If-Match header. A stale revision is rejected by the API instead of silently overwriting a newer edit.

Time, customer, address, and note blocks support fieldLayout: "inline" | "stacked". Existing definitions default to inline. In stacked mode, labelStyle controls each field heading while style independently controls its value; stacked layout is rejected for other block types.

order_times blocks support showDate: false when a receipt should print only the localized time. Missing or null values retain the legacy date-and-time format. The option is rejected on every other block type.

版本与发布记录

@deliverart/sdk-js-receipt-template 共发布 63 个版本,首次发布于 2026/07/15;过去 12 个月发布了 63 个版本。

版本发布日期距今
3.0.1latest2026/11/111 天前
3.0.02026/11/092 天前
3.0.0-dev.1dev2026/11/092 天前
2.48.12026/10/2518 天前
2.48.02026/10/2319 天前
2.47.02026/10/2319 天前

关于 @deliverart/sdk-js-receipt-template 的常见问题

@deliverart/sdk-js-receipt-template 是什么?

Deliverart JavaScript SDK for versioned receipt templates

如何安装 @deliverart/sdk-js-receipt-template?

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

@deliverart/sdk-js-receipt-template 支持 TypeScript 吗?

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

@deliverart/sdk-js-receipt-template 支持 ESM 还是 CommonJS?

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

@deliverart/sdk-js-receipt-template 可以商用吗?

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

@deliverart/sdk-js-receipt-template 的下载量有多少?

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

@deliverart/sdk-js-receipt-template 还在维护吗?

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