@12-apps/product-research

中文文档
2.12.0发布于 2026/11/11MITES Module构建来源已验证近 30 天下载 3.3万

Generic, portable research-to-buy engine: multi-source current-price discovery (store connectors, SERP, manual price lists), no-AI relevance scoring, unit-price ranking. Framework-free core with host ports (db/cache/budget/catalog). Zero app coupling.

原始使用文档

@12-apps/product-research

Multi-source price research: store connectors, a paid search provider and manual price lists, scored for relevance and ranked by unit price. This page covers only the copy a host supplies; the types carry the rest.

  • Every sentence is host config. The package compiles in no wording a reader sees. Each surface takes its copy as a REQUIRED field, either a table or a resolver (ctx) => table (ResearchCopySource<T>, the shape localeCopy(PACK) from @12-apps/i18n returns).
  • Both languages ship, as named packs. ./en-US and ./pt-BR export them; nothing defaults to either. The root entry and ./locales export the same packs keyed by tag, for a resolver.

The packs, and where each one plugs in

fielden-USpt-BRkeyed by tag
diagnostics on createApiProductResearch (./http), on ConnectorContext and on ResearchDeps (runResearch)EN_US_RESEARCH_DIAGNOSTICSPT_BR_RESEARCH_DIAGNOSTICSRESEARCH_DIAGNOSTICS
messages on createApiProductResearchEN_US_RESEARCH_MESSAGESPT_BR_RESEARCH_MESSAGESRESEARCH_HTTP_MESSAGES
the argument of createResearchBudgetBlueprint (./manifest)EN_US_RESEARCH_BUDGET_COPYPT_BR_RESEARCH_BUDGET_COPYRESEARCH_BUDGET_COPY
permission segment labels, composed beside the contribution by handEN_US_RESEARCH_PERMISSION_LABELSPT_BR_RESEARCH_PERMISSION_LABELSRESEARCH_PERMISSION_LABELS
import { PT_BR_RESEARCH_DIAGNOSTICS } from '@12-apps/product-research/pt-BR';

const ctx: ConnectorContext = {
  logger,
  fetchJson,
  diagnostics: PT_BR_RESEARCH_DIAGNOSTICS,
  locale: 'pt-BR',
};

Pass the same diagnostics (and locale) to ConnectorContext and ResearchDeps: the pipeline's own verdicts and the connectors' failures land in one report.

MARKET_VOCABULARY (EN_US_MARKET_VOCABULARY, PT_BR_MARKET_VOCABULARY) is not copy. It is the words the package READS in a store's pages and a supplier's sheet, so it follows the market being searched, never the reader, and vocabulary takes a table rather than a resolver.

Connector failures

diagnostics.connectors words the connectors' own failures: the Mercado Livre search and catalog lookup answering nothing (mercadoLivreSearchUnreachable(url), mercadoLivreCatalogUnreachable(url)), a missing access token (mercadoLivreAuthFailed(sourceLabel)), the manual price store throwing (manualStoreUnavailable(cause)) and a source type with no connector (noConnector(sourceType)). The block is OPTIONAL so an older pack keeps compiling; without it the connectors record the English of EN_US_RESEARCH_DIAGNOSTICS.connectors, which is what they always recorded. Both packs fill it. The reasons carry the failing request's URL or the store's cause, because the reason on the source row is the only diagnosis an admin gets.

版本与发布记录

@12-apps/product-research 共发布 46 个版本,首次发布于 2026/08/05;过去 12 个月发布了 46 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.12.0latest2026/11/11今天
2.11.02026/10/2517 天前
2.10.02026/08/262 个月前
2.9.02026/08/252 个月前
2.8.02026/08/252 个月前
2.7.02026/08/252 个月前

关于 @12-apps/product-research 的常见问题

@12-apps/product-research 是什么?

Generic, portable research-to-buy engine: multi-source current-price discovery (store connectors, SERP, manual price lists), no-AI relevance scoring, unit-price ranking. Framework-free core with host ports (db/cache/budget/catalog). Zero app coupling.

如何安装 @12-apps/product-research?

在项目目录运行 npm install @12-apps/product-research,或使用 pnpm add / yarn add / bun add。

@12-apps/product-research 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/12-apps__product-research 是否存在。

@12-apps/product-research 支持 ESM 还是 CommonJS?

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

@12-apps/product-research 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@12-apps/product-research 可以商用吗?

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

@12-apps/product-research 的下载量有多少?

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

@12-apps/product-research 还在维护吗?

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