@happyvertical/smrt-affiliates

中文文档
0.62.1发布于 2026/11/17MITTypeScriptES Module近 30 天下载 1.4万

DEPRECATED compatibility shim over @happyvertical/smrt-sales — re-exports the legacy Partner/Commission/Payout names. See MIGRATION.md.

原始使用文档
文档目录3 节
  1. Migrating
  2. Installation (legacy consumers)
  3. License

@happyvertical/smrt-affiliates

DEPRECATED — this package is a compatibility shim over @happyvertical/smrt-sales and will be removed in a future major release.

The affiliate models that used to live here (Partner, Commission, Payout) were generalized into the neutral commissions core of @happyvertical/smrt-sales. This package now declares no models and owns no persistence — it only re-exports the new classes under the legacy names so existing imports keep compiling while you migrate:

Legacy import (this package)Actual class (@happyvertical/smrt-sales)
Partner / PartnerCollectionEarner / EarnerCollection
Commission / CommissionCollectionCommission / CommissionCollection (new shape)
Payout / PayoutCollectionCommissionPayout / CommissionPayoutCollection
PartnerStatus, PartnerType, CommissionType, CommissionStatus, PayoutStatus, PayoutMethodfrozen legacy-shaped const objects (see notes in AGENTS.md)

Migrating

  • New code: import from @happyvertical/smrt-sales directly — Earner, CommissionPlan, EarningEvent, Commission, CommissionAdjustment, CommissionPayout, the collections, services, and money helpers.
  • Partner roles: publisher/salesperson/referrer role flags are replaced by first-class role models — Referrer (@happyvertical/smrt-sales/referrals) and SalesRepresentative (@happyvertical/smrt-sales/crm) — each holding an earnerId that points at the shared financial account.
  • Data: the full table/column/status mapping, behavioral changes (tenancy, lifecycle, rate representation), and SQL migration sketches live in MIGRATION.md.

Installation (legacy consumers)

pnpm add @happyvertical/smrt-affiliates
// Still compiles — these are the smrt-sales classes under their old names.
import { Partner, PartnerCollection, Payout } from '@happyvertical/smrt-affiliates';

License

MIT

版本与发布记录

@happyvertical/smrt-affiliates 共发布 366 个版本,首次发布于 2026/06/23;过去 12 个月发布了 366 个版本。

版本发布日期距今
0.62.1latest2026/11/17今天
0.62.02026/11/17今天
0.61.62026/11/161 天前
0.61.52026/11/161 天前
0.61.42026/11/161 天前
0.61.32026/11/152 天前

关于 @happyvertical/smrt-affiliates 的常见问题

@happyvertical/smrt-affiliates 是什么?

DEPRECATED compatibility shim over @happyvertical/smrt-sales — re-exports the legacy Partner/Commission/Payout names. See MIGRATION.md.

如何安装 @happyvertical/smrt-affiliates?

在项目目录运行 npm install @happyvertical/smrt-affiliates,或使用 pnpm add / yarn add / bun add。

@happyvertical/smrt-affiliates 支持 TypeScript 吗?

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

@happyvertical/smrt-affiliates 支持 ESM 还是 CommonJS?

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

@happyvertical/smrt-affiliates 可以商用吗?

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

@happyvertical/smrt-affiliates 的下载量有多少?

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

@happyvertical/smrt-affiliates 还在维护吗?

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