xytara 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/index.js +1 -1
- package/lib/commerce_client.js +48 -0
- package/package.json +1 -1
- package/server.js +145 -0
package/README.md
CHANGED
|
@@ -217,6 +217,15 @@ The current `1.21.0` line starts turning that adapter-operable execution contrac
|
|
|
217
217
|
|
|
218
218
|
This is intended to make the transaction-side continuation path easier to depend on repeatedly as a durable public operating contract instead of only a contract that is operable in the moment.
|
|
219
219
|
|
|
220
|
+
The current `1.22.0` line starts turning that adapter-stable operating contract into a clearer adapter-reliable operating interface:
|
|
221
|
+
|
|
222
|
+
- operating-interface summaries on top of the default operating-contract path
|
|
223
|
+
- compact operating-interface bundles for direct adapter-facing reliable interface posture
|
|
224
|
+
- default operating-interface summaries for the next proof-side operating-interface run posture
|
|
225
|
+
- clearer operating-interface ids and stable reliable interface carry
|
|
226
|
+
|
|
227
|
+
This is intended to make the transaction-side continuation path easier to rely on operationally as a durable public interface instead of only a stable operating contract shape.
|
|
228
|
+
|
|
220
229
|
## Package Surface
|
|
221
230
|
|
|
222
231
|
The SDK is broad, but it stays organized into a few repeatable families instead of one-off surfaces.
|
package/index.js
CHANGED
package/lib/commerce_client.js
CHANGED
|
@@ -4824,6 +4824,54 @@ class CommerceClient {
|
|
|
4824
4824
|
});
|
|
4825
4825
|
}
|
|
4826
4826
|
|
|
4827
|
+
async prepareInteractionResultPackageOperatingInterfaceSummary(continuationRef, body, options) {
|
|
4828
|
+
const opts = options || {};
|
|
4829
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-interface-summary", {
|
|
4830
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.interface.summary",
|
|
4831
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4832
|
+
body: body || {},
|
|
4833
|
+
callback_url: opts.callbackUrl || null,
|
|
4834
|
+
settlement_mode: opts.settlementMode || null,
|
|
4835
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4836
|
+
protocol: opts.protocol || null,
|
|
4837
|
+
integration_id: opts.integrationId || null,
|
|
4838
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4839
|
+
integration_context: opts.integrationContext || null
|
|
4840
|
+
});
|
|
4841
|
+
}
|
|
4842
|
+
|
|
4843
|
+
async prepareInteractionResultPackageOperatingInterfaceBundle(continuationRef, body, options) {
|
|
4844
|
+
const opts = options || {};
|
|
4845
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-interface-bundle", {
|
|
4846
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.interface.bundle",
|
|
4847
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4848
|
+
body: body || {},
|
|
4849
|
+
callback_url: opts.callbackUrl || null,
|
|
4850
|
+
settlement_mode: opts.settlementMode || null,
|
|
4851
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4852
|
+
protocol: opts.protocol || null,
|
|
4853
|
+
integration_id: opts.integrationId || null,
|
|
4854
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4855
|
+
integration_context: opts.integrationContext || null
|
|
4856
|
+
});
|
|
4857
|
+
}
|
|
4858
|
+
|
|
4859
|
+
async prepareInteractionResultPackageOperatingInterfaceDefaultSummary(continuationRef, body, options) {
|
|
4860
|
+
const opts = options || {};
|
|
4861
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-interface-default-summary", {
|
|
4862
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.interface.default.summary",
|
|
4863
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4864
|
+
body: body || {},
|
|
4865
|
+
callback_url: opts.callbackUrl || null,
|
|
4866
|
+
settlement_mode: opts.settlementMode || null,
|
|
4867
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4868
|
+
protocol: opts.protocol || null,
|
|
4869
|
+
integration_id: opts.integrationId || null,
|
|
4870
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4871
|
+
integration_context: opts.integrationContext || null
|
|
4872
|
+
});
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4827
4875
|
async runNamedTaskRoute(path, payload) {
|
|
4828
4876
|
if (!this.apiKey || !this.walletId || !this.walletSecret) {
|
|
4829
4877
|
throw new Error("named task routes require apiKey, walletId, and walletSecret");
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1724,6 +1724,58 @@ function buildPreparedContinuationDefaultOperatingContractSummary(portableHandof
|
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
1727
|
+
function buildPreparedContinuationAdapterReliableOperatingInterfaceSummary(portableHandoff, continuation) {
|
|
1728
|
+
const operatingContract = buildPreparedContinuationDefaultOperatingContractSummary(portableHandoff, continuation);
|
|
1729
|
+
return {
|
|
1730
|
+
ok: operatingContract.ok === true,
|
|
1731
|
+
default_operating_contract_ref: operatingContract.default_operating_contract_ref || null,
|
|
1732
|
+
operating_interface_ref: operatingContract.default_operating_contract_ref
|
|
1733
|
+
? `interface.${operatingContract.default_operating_contract_ref}`
|
|
1734
|
+
: null,
|
|
1735
|
+
reliable_operating_interface_ids: Array.isArray(operatingContract.stable_default_operating_contract_ids)
|
|
1736
|
+
? operatingContract.stable_default_operating_contract_ids
|
|
1737
|
+
: [],
|
|
1738
|
+
operating_interface_carry: operatingContract.default_operating_contract_carry || {},
|
|
1739
|
+
adapter_reliable: operatingContract.operating_stable_by_default === true,
|
|
1740
|
+
next_surface: "/v1/proof-center/result-package-handoff/review/operating-interface"
|
|
1741
|
+
};
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
function buildPreparedContinuationAdapterReliableOperatingInterfaceBundle(portableHandoff, continuation) {
|
|
1745
|
+
const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
|
|
1746
|
+
const summary = buildPreparedContinuationAdapterReliableOperatingInterfaceSummary(portableHandoff, continuation);
|
|
1747
|
+
return {
|
|
1748
|
+
ok: true,
|
|
1749
|
+
operating_interface_summary: summary,
|
|
1750
|
+
operating_interface_template: {
|
|
1751
|
+
ok: true,
|
|
1752
|
+
operating_interface_ref: summary.operating_interface_ref || null,
|
|
1753
|
+
target_surface: "/v1/proof-center/result-package-handoff/review/operating-interface",
|
|
1754
|
+
request_template: {
|
|
1755
|
+
handoff_bundle: handoff
|
|
1756
|
+
},
|
|
1757
|
+
stable_boundary_ids: Array.isArray(summary.reliable_operating_interface_ids) ? summary.reliable_operating_interface_ids : []
|
|
1758
|
+
}
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
function buildPreparedContinuationDefaultOperatingInterfaceSummary(portableHandoff, continuation) {
|
|
1763
|
+
const operatingInterface = buildPreparedContinuationAdapterReliableOperatingInterfaceSummary(portableHandoff, continuation);
|
|
1764
|
+
return {
|
|
1765
|
+
ok: operatingInterface.ok === true,
|
|
1766
|
+
operating_interface_ref: operatingInterface.operating_interface_ref || null,
|
|
1767
|
+
default_operating_interface_ref: operatingInterface.operating_interface_ref
|
|
1768
|
+
? `default.${operatingInterface.operating_interface_ref}`
|
|
1769
|
+
: null,
|
|
1770
|
+
stable_default_operating_interface_ids: Array.isArray(operatingInterface.reliable_operating_interface_ids)
|
|
1771
|
+
? operatingInterface.reliable_operating_interface_ids
|
|
1772
|
+
: [],
|
|
1773
|
+
default_operating_interface_carry: operatingInterface.operating_interface_carry || {},
|
|
1774
|
+
operating_interface_reliable_by_default: operatingInterface.adapter_reliable === true,
|
|
1775
|
+
next_surface: "/v1/proof-center/result-package-handoff/review/operating-interface-run"
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1727
1779
|
function buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation) {
|
|
1728
1780
|
const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
|
|
1729
1781
|
return {
|
|
@@ -3535,6 +3587,99 @@ async function routeRequest(req, res) {
|
|
|
3535
3587
|
return;
|
|
3536
3588
|
}
|
|
3537
3589
|
|
|
3590
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-interface-summary") {
|
|
3591
|
+
const body = await readJsonBody(req);
|
|
3592
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3593
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3594
|
+
if (!continuation) {
|
|
3595
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3596
|
+
return;
|
|
3597
|
+
}
|
|
3598
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3599
|
+
if (!resultPackage) {
|
|
3600
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3601
|
+
return;
|
|
3602
|
+
}
|
|
3603
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3604
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3605
|
+
spine_path_ref: resultPackage.source_ref
|
|
3606
|
+
});
|
|
3607
|
+
if (!payload) {
|
|
3608
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3609
|
+
return;
|
|
3610
|
+
}
|
|
3611
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3612
|
+
if (result.status !== 200) {
|
|
3613
|
+
sendJson(res, result.status, result.payload);
|
|
3614
|
+
return;
|
|
3615
|
+
}
|
|
3616
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3617
|
+
sendJson(res, 200, buildPreparedContinuationAdapterReliableOperatingInterfaceSummary(portableHandoff, continuation));
|
|
3618
|
+
return;
|
|
3619
|
+
}
|
|
3620
|
+
|
|
3621
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-interface-bundle") {
|
|
3622
|
+
const body = await readJsonBody(req);
|
|
3623
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3624
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3625
|
+
if (!continuation) {
|
|
3626
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3627
|
+
return;
|
|
3628
|
+
}
|
|
3629
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3630
|
+
if (!resultPackage) {
|
|
3631
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3632
|
+
return;
|
|
3633
|
+
}
|
|
3634
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3635
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3636
|
+
spine_path_ref: resultPackage.source_ref
|
|
3637
|
+
});
|
|
3638
|
+
if (!payload) {
|
|
3639
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3640
|
+
return;
|
|
3641
|
+
}
|
|
3642
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3643
|
+
if (result.status !== 200) {
|
|
3644
|
+
sendJson(res, result.status, result.payload);
|
|
3645
|
+
return;
|
|
3646
|
+
}
|
|
3647
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3648
|
+
sendJson(res, 200, buildPreparedContinuationAdapterReliableOperatingInterfaceBundle(portableHandoff, continuation));
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-interface-default-summary") {
|
|
3653
|
+
const body = await readJsonBody(req);
|
|
3654
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3655
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3656
|
+
if (!continuation) {
|
|
3657
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3658
|
+
return;
|
|
3659
|
+
}
|
|
3660
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3661
|
+
if (!resultPackage) {
|
|
3662
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3663
|
+
return;
|
|
3664
|
+
}
|
|
3665
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3666
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3667
|
+
spine_path_ref: resultPackage.source_ref
|
|
3668
|
+
});
|
|
3669
|
+
if (!payload) {
|
|
3670
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3671
|
+
return;
|
|
3672
|
+
}
|
|
3673
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3674
|
+
if (result.status !== 200) {
|
|
3675
|
+
sendJson(res, result.status, result.payload);
|
|
3676
|
+
return;
|
|
3677
|
+
}
|
|
3678
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3679
|
+
sendJson(res, 200, buildPreparedContinuationDefaultOperatingInterfaceSummary(portableHandoff, continuation));
|
|
3680
|
+
return;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3538
3683
|
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/contract-template") {
|
|
3539
3684
|
const body = await readJsonBody(req);
|
|
3540
3685
|
const continuationRef = String(body && body.continuation_ref || "").trim();
|