@cacic-fct/account-manager-m2m-contracts

中文文档
0.2.2发布于 2026/10/25AGPL-3.0-onlyTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 5656

Framework-agnostic CACiC Account Manager gRPC contracts.

原始使用文档
文档目录4 节
  1. Install
  2. Use
  3. Building
  4. Publishing

@cacic-fct/account-manager-m2m-contracts

Framework-agnostic contracts for CACiC Account Manager machine-to-machine APIs.

The package exports the canonical gRPC contract, privacy setting keys, M2M role names, request/response types, privacy directive constants, PURR-style header and cookie names, and shared CACiC analytics tracking cookie names used by Account Manager.

Install

Install from the public npm registry with Bun:

bun add @cacic-fct/account-manager-m2m-contracts

Use

New machine-to-machine integrations should load proto/cacic/m2m/account_manager/v1.proto, use the AccountManagerM2M service, and send a Keycloak service-account bearer token in gRPC metadata.

Browser-facing privacy and analytics integrations remain REST-based through CACIC_TRACKING_ROUTES and the authenticated /api/privacy/* endpoints; they are separate from the privileged M2M transport.

import {
  M2M_PRIVACY_ROLES,
  M2M_USER_ROLES,
  CACIC_TRACKING_ROUTES,
  PRIVACY_SETTING_TYPES,
} from '@cacic-fct/account-manager-m2m-contracts';

const trackingRefreshUrl = CACIC_TRACKING_ROUTES.session;
const privacyReadRole = M2M_PRIVACY_ROLES.READ;
const userLookupRole = M2M_USER_ROLES.READ;
const analyticsSetting = PRIVACY_SETTING_TYPES.ANALYTICS_TRACKING;

Building

Run bunx nx build m2m-contracts to build the library.

The built package also includes the canonical proto/cacic/m2m/account_manager/v1.proto gRPC contract. Runtime services should use that contract over an internal, scoped network and continue sending Keycloak service-account tokens in gRPC metadata.

Publishing

This package has an independent release cycle. Bump this package's own version before merging changes that should be published.

Run bun run publish:m2m-contracts from the repository root when publishing manually. The CI workflow publishes this package to npm through Trusted Publishing.

版本与发布记录

@cacic-fct/account-manager-m2m-contracts 共发布 9 个版本,首次发布于 2026/06/25;过去 12 个月发布了 9 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.2latest2026/10/2515 天前
0.2.12026/10/041 个月前
0.2.02026/09/082 个月前
0.1.52026/08/202 个月前
0.1.42026/08/132 个月前
0.1.32026/07/273 个月前

关于 @cacic-fct/account-manager-m2m-contracts 的常见问题

@cacic-fct/account-manager-m2m-contracts 是什么?

Framework-agnostic CACiC Account Manager gRPC contracts.

如何安装 @cacic-fct/account-manager-m2m-contracts?

在项目目录运行 npm install @cacic-fct/account-manager-m2m-contracts,或使用 pnpm add / yarn add / bun add。

@cacic-fct/account-manager-m2m-contracts 支持 TypeScript 吗?

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

@cacic-fct/account-manager-m2m-contracts 支持 ESM 还是 CommonJS?

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

@cacic-fct/account-manager-m2m-contracts 可以商用吗?

@cacic-fct/account-manager-m2m-contracts 使用 AGPL-3.0-only 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@cacic-fct/account-manager-m2m-contracts 的下载量有多少?

根据 npm 官方下载统计,@cacic-fct/account-manager-m2m-contracts 在 2026/10/09 – 2026/11/07 这 30 天内被下载 5,656 次,日均约 189 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cacic-fct/account-manager-m2m-contracts 还在维护吗?

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