@absolutejs/handoff
存储中性关联 以及留下你申请的作品证据.
在您的代码中开始交接, 在外部系统中继续, 并可能返回
通过召回、核对或客户报告. @absolutejs/handoff
保留这些观察,而不假装您的申请可以检查
一个直接的外部页面.
安装
bun add @absolutejs/handoff
关联
import {
handoffCorrelationFrom,
withHandoffCorrelation,
} from "@absolutejs/handoff";
const metadata = withHandoffCorrelation(
{ campaign: "summer" },
crypto.randomUUID(),
);
// Services with fixed metadata slots can name the slot explicitly.
const gatewayFields = withHandoffCorrelation(
{ field_1: "campaign" },
crypto.randomUUID(),
"field_20",
);
const correlationId = handoffCorrelationFrom(gatewayFields, "field_20");
证据与和解
import { summarizeHandoff } from "@absolutejs/handoff";
const summary = summarizeHandoff([
{
at: Date.now(),
correlationId: "invoice-123",
operation: "invoice_payment",
outcome: "succeeded",
service: "gateway",
source: "callback",
},
{
at: Date.now() + 1,
correlationId: "invoice-123",
message: "The hosted page displayed an error",
operation: "invoice_payment",
outcome: "failed",
service: "gateway",
source: "external_surface_report",
},
]);
// The callback remains authoritative while the customer-visible contradiction
// remains actionable.
console.log(summary.status); // "succeeded"
console.log(summary.contradiction); // true
external_api, (中文(简体) ), callback,以及 reconciliation 证据具有权威性.
external_surface_report 证据记录客户或经营者看到的东西
没有沉默地凌驾于外部系统真理之上.
记录
createHandoffRecorder() 接受任择储存和观察员合同.
记录每下沉输出状态的返回, 而不是丢弃当
可观察性沉没失败,所以能见度无法打破业务操作.
收录器还按出处和结果披露了低心率反相.
信件和参考文献编辑后付款编号为正文和无记名文本 证书。 应用程序必须保留原始回调、证书、付款 详细信息,以及客户数据 在他们自己的受保护的商店.
软件包边界
@absolutejs/handoff 拥有共享协议。 域包保留自己的
意义和适配器:
- 商业决定什么是支付, 拒绝, 和定居的卑鄙.
- 调度决定什么是发送,反弹,抱怨的恶意.
- CRM决定同步或相冲突的含义.
- 声音和会议决定加入、录制和转录的意思.
这些软件包将外部系统的证据转换成这个中性词汇.
许可证
麻省理工学院