xytara 1.21.0 → 1.23.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 +18 -0
- package/index.js +1 -1
- package/lib/commerce_client.js +96 -0
- package/package.json +1 -1
- package/server.js +290 -0
package/README.md
CHANGED
|
@@ -217,6 +217,24 @@ 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
|
+
|
|
229
|
+
The current `1.23.0` line starts turning that adapter-reliable operating interface into a clearer adapter-integrable operating path:
|
|
230
|
+
|
|
231
|
+
- operating-integration summaries on top of the default operating-interface path
|
|
232
|
+
- compact operating-integration bundles for direct adapter-facing integration posture
|
|
233
|
+
- default operating-integration summaries for the next proof-side operating-integration run posture
|
|
234
|
+
- clearer operating-integration ids and stable integrable carry
|
|
235
|
+
|
|
236
|
+
This is intended to make the transaction-side continuation path easier to plug into adapters directly as a durable public operating path instead of only a reliable interface shape.
|
|
237
|
+
|
|
220
238
|
## Package Surface
|
|
221
239
|
|
|
222
240
|
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,102 @@ 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
|
+
|
|
4875
|
+
async prepareInteractionResultPackageOperatingIntegrationSummary(continuationRef, body, options) {
|
|
4876
|
+
const opts = options || {};
|
|
4877
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-integration-summary", {
|
|
4878
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.integration.summary",
|
|
4879
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4880
|
+
body: body || {},
|
|
4881
|
+
callback_url: opts.callbackUrl || null,
|
|
4882
|
+
settlement_mode: opts.settlementMode || null,
|
|
4883
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4884
|
+
protocol: opts.protocol || null,
|
|
4885
|
+
integration_id: opts.integrationId || null,
|
|
4886
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4887
|
+
integration_context: opts.integrationContext || null
|
|
4888
|
+
});
|
|
4889
|
+
}
|
|
4890
|
+
|
|
4891
|
+
async prepareInteractionResultPackageOperatingIntegrationBundle(continuationRef, body, options) {
|
|
4892
|
+
const opts = options || {};
|
|
4893
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-integration-bundle", {
|
|
4894
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.integration.bundle",
|
|
4895
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4896
|
+
body: body || {},
|
|
4897
|
+
callback_url: opts.callbackUrl || null,
|
|
4898
|
+
settlement_mode: opts.settlementMode || null,
|
|
4899
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4900
|
+
protocol: opts.protocol || null,
|
|
4901
|
+
integration_id: opts.integrationId || null,
|
|
4902
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4903
|
+
integration_context: opts.integrationContext || null
|
|
4904
|
+
});
|
|
4905
|
+
}
|
|
4906
|
+
|
|
4907
|
+
async prepareInteractionResultPackageOperatingIntegrationDefaultSummary(continuationRef, body, options) {
|
|
4908
|
+
const opts = options || {};
|
|
4909
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-integration-default-summary", {
|
|
4910
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.integration.default.summary",
|
|
4911
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4912
|
+
body: body || {},
|
|
4913
|
+
callback_url: opts.callbackUrl || null,
|
|
4914
|
+
settlement_mode: opts.settlementMode || null,
|
|
4915
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4916
|
+
protocol: opts.protocol || null,
|
|
4917
|
+
integration_id: opts.integrationId || null,
|
|
4918
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4919
|
+
integration_context: opts.integrationContext || null
|
|
4920
|
+
});
|
|
4921
|
+
}
|
|
4922
|
+
|
|
4827
4923
|
async runNamedTaskRoute(path, payload) {
|
|
4828
4924
|
if (!this.apiKey || !this.walletId || !this.walletSecret) {
|
|
4829
4925
|
throw new Error("named task routes require apiKey, walletId, and walletSecret");
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1724,6 +1724,110 @@ 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
|
+
|
|
1779
|
+
function buildPreparedContinuationAdapterIntegrableOperatingIntegrationSummary(portableHandoff, continuation) {
|
|
1780
|
+
const operatingInterface = buildPreparedContinuationDefaultOperatingInterfaceSummary(portableHandoff, continuation);
|
|
1781
|
+
return {
|
|
1782
|
+
ok: operatingInterface.ok === true,
|
|
1783
|
+
default_operating_interface_ref: operatingInterface.default_operating_interface_ref || null,
|
|
1784
|
+
operating_integration_ref: operatingInterface.default_operating_interface_ref
|
|
1785
|
+
? `integration.${operatingInterface.default_operating_interface_ref}`
|
|
1786
|
+
: null,
|
|
1787
|
+
integrable_operating_ids: Array.isArray(operatingInterface.stable_default_operating_interface_ids)
|
|
1788
|
+
? operatingInterface.stable_default_operating_interface_ids
|
|
1789
|
+
: [],
|
|
1790
|
+
operating_integration_carry: operatingInterface.default_operating_interface_carry || {},
|
|
1791
|
+
adapter_integrable: operatingInterface.operating_interface_reliable_by_default === true,
|
|
1792
|
+
next_surface: "/v1/proof-center/result-package-handoff/review/operating-integration"
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
function buildPreparedContinuationAdapterIntegrableOperatingIntegrationBundle(portableHandoff, continuation) {
|
|
1797
|
+
const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
|
|
1798
|
+
const summary = buildPreparedContinuationAdapterIntegrableOperatingIntegrationSummary(portableHandoff, continuation);
|
|
1799
|
+
return {
|
|
1800
|
+
ok: true,
|
|
1801
|
+
operating_integration_summary: summary,
|
|
1802
|
+
operating_integration_template: {
|
|
1803
|
+
ok: true,
|
|
1804
|
+
operating_integration_ref: summary.operating_integration_ref || null,
|
|
1805
|
+
target_surface: "/v1/proof-center/result-package-handoff/review/operating-integration",
|
|
1806
|
+
request_template: {
|
|
1807
|
+
handoff_bundle: handoff
|
|
1808
|
+
},
|
|
1809
|
+
stable_boundary_ids: Array.isArray(summary.integrable_operating_ids) ? summary.integrable_operating_ids : []
|
|
1810
|
+
}
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
function buildPreparedContinuationDefaultOperatingIntegrationSummary(portableHandoff, continuation) {
|
|
1815
|
+
const operatingIntegration = buildPreparedContinuationAdapterIntegrableOperatingIntegrationSummary(portableHandoff, continuation);
|
|
1816
|
+
return {
|
|
1817
|
+
ok: operatingIntegration.ok === true,
|
|
1818
|
+
operating_integration_ref: operatingIntegration.operating_integration_ref || null,
|
|
1819
|
+
default_operating_integration_ref: operatingIntegration.operating_integration_ref
|
|
1820
|
+
? `default.${operatingIntegration.operating_integration_ref}`
|
|
1821
|
+
: null,
|
|
1822
|
+
stable_default_operating_integration_ids: Array.isArray(operatingIntegration.integrable_operating_ids)
|
|
1823
|
+
? operatingIntegration.integrable_operating_ids
|
|
1824
|
+
: [],
|
|
1825
|
+
default_operating_integration_carry: operatingIntegration.operating_integration_carry || {},
|
|
1826
|
+
operating_integration_integrable_by_default: operatingIntegration.adapter_integrable === true,
|
|
1827
|
+
next_surface: "/v1/proof-center/result-package-handoff/review/operating-integration-run"
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1727
1831
|
function buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation) {
|
|
1728
1832
|
const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
|
|
1729
1833
|
return {
|
|
@@ -3535,6 +3639,192 @@ async function routeRequest(req, res) {
|
|
|
3535
3639
|
return;
|
|
3536
3640
|
}
|
|
3537
3641
|
|
|
3642
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-interface-summary") {
|
|
3643
|
+
const body = await readJsonBody(req);
|
|
3644
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3645
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3646
|
+
if (!continuation) {
|
|
3647
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3648
|
+
return;
|
|
3649
|
+
}
|
|
3650
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3651
|
+
if (!resultPackage) {
|
|
3652
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3653
|
+
return;
|
|
3654
|
+
}
|
|
3655
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3656
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3657
|
+
spine_path_ref: resultPackage.source_ref
|
|
3658
|
+
});
|
|
3659
|
+
if (!payload) {
|
|
3660
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3661
|
+
return;
|
|
3662
|
+
}
|
|
3663
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3664
|
+
if (result.status !== 200) {
|
|
3665
|
+
sendJson(res, result.status, result.payload);
|
|
3666
|
+
return;
|
|
3667
|
+
}
|
|
3668
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3669
|
+
sendJson(res, 200, buildPreparedContinuationAdapterReliableOperatingInterfaceSummary(portableHandoff, continuation));
|
|
3670
|
+
return;
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-interface-bundle") {
|
|
3674
|
+
const body = await readJsonBody(req);
|
|
3675
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3676
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3677
|
+
if (!continuation) {
|
|
3678
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3679
|
+
return;
|
|
3680
|
+
}
|
|
3681
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3682
|
+
if (!resultPackage) {
|
|
3683
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3684
|
+
return;
|
|
3685
|
+
}
|
|
3686
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3687
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3688
|
+
spine_path_ref: resultPackage.source_ref
|
|
3689
|
+
});
|
|
3690
|
+
if (!payload) {
|
|
3691
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3692
|
+
return;
|
|
3693
|
+
}
|
|
3694
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3695
|
+
if (result.status !== 200) {
|
|
3696
|
+
sendJson(res, result.status, result.payload);
|
|
3697
|
+
return;
|
|
3698
|
+
}
|
|
3699
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3700
|
+
sendJson(res, 200, buildPreparedContinuationAdapterReliableOperatingInterfaceBundle(portableHandoff, continuation));
|
|
3701
|
+
return;
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-interface-default-summary") {
|
|
3705
|
+
const body = await readJsonBody(req);
|
|
3706
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3707
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3708
|
+
if (!continuation) {
|
|
3709
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3710
|
+
return;
|
|
3711
|
+
}
|
|
3712
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3713
|
+
if (!resultPackage) {
|
|
3714
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3715
|
+
return;
|
|
3716
|
+
}
|
|
3717
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3718
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3719
|
+
spine_path_ref: resultPackage.source_ref
|
|
3720
|
+
});
|
|
3721
|
+
if (!payload) {
|
|
3722
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3723
|
+
return;
|
|
3724
|
+
}
|
|
3725
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3726
|
+
if (result.status !== 200) {
|
|
3727
|
+
sendJson(res, result.status, result.payload);
|
|
3728
|
+
return;
|
|
3729
|
+
}
|
|
3730
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3731
|
+
sendJson(res, 200, buildPreparedContinuationDefaultOperatingInterfaceSummary(portableHandoff, continuation));
|
|
3732
|
+
return;
|
|
3733
|
+
}
|
|
3734
|
+
|
|
3735
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-integration-summary") {
|
|
3736
|
+
const body = await readJsonBody(req);
|
|
3737
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3738
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3739
|
+
if (!continuation) {
|
|
3740
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3741
|
+
return;
|
|
3742
|
+
}
|
|
3743
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3744
|
+
if (!resultPackage) {
|
|
3745
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3746
|
+
return;
|
|
3747
|
+
}
|
|
3748
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3749
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3750
|
+
spine_path_ref: resultPackage.source_ref
|
|
3751
|
+
});
|
|
3752
|
+
if (!payload) {
|
|
3753
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3754
|
+
return;
|
|
3755
|
+
}
|
|
3756
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3757
|
+
if (result.status !== 200) {
|
|
3758
|
+
sendJson(res, result.status, result.payload);
|
|
3759
|
+
return;
|
|
3760
|
+
}
|
|
3761
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3762
|
+
sendJson(res, 200, buildPreparedContinuationAdapterIntegrableOperatingIntegrationSummary(portableHandoff, continuation));
|
|
3763
|
+
return;
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-integration-bundle") {
|
|
3767
|
+
const body = await readJsonBody(req);
|
|
3768
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3769
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3770
|
+
if (!continuation) {
|
|
3771
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3772
|
+
return;
|
|
3773
|
+
}
|
|
3774
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3775
|
+
if (!resultPackage) {
|
|
3776
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3777
|
+
return;
|
|
3778
|
+
}
|
|
3779
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3780
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3781
|
+
spine_path_ref: resultPackage.source_ref
|
|
3782
|
+
});
|
|
3783
|
+
if (!payload) {
|
|
3784
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3785
|
+
return;
|
|
3786
|
+
}
|
|
3787
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3788
|
+
if (result.status !== 200) {
|
|
3789
|
+
sendJson(res, result.status, result.payload);
|
|
3790
|
+
return;
|
|
3791
|
+
}
|
|
3792
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3793
|
+
sendJson(res, 200, buildPreparedContinuationAdapterIntegrableOperatingIntegrationBundle(portableHandoff, continuation));
|
|
3794
|
+
return;
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-integration-default-summary") {
|
|
3798
|
+
const body = await readJsonBody(req);
|
|
3799
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3800
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3801
|
+
if (!continuation) {
|
|
3802
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3803
|
+
return;
|
|
3804
|
+
}
|
|
3805
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3806
|
+
if (!resultPackage) {
|
|
3807
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3808
|
+
return;
|
|
3809
|
+
}
|
|
3810
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3811
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3812
|
+
spine_path_ref: resultPackage.source_ref
|
|
3813
|
+
});
|
|
3814
|
+
if (!payload) {
|
|
3815
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3816
|
+
return;
|
|
3817
|
+
}
|
|
3818
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3819
|
+
if (result.status !== 200) {
|
|
3820
|
+
sendJson(res, result.status, result.payload);
|
|
3821
|
+
return;
|
|
3822
|
+
}
|
|
3823
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3824
|
+
sendJson(res, 200, buildPreparedContinuationDefaultOperatingIntegrationSummary(portableHandoff, continuation));
|
|
3825
|
+
return;
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3538
3828
|
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/contract-template") {
|
|
3539
3829
|
const body = await readJsonBody(req);
|
|
3540
3830
|
const continuationRef = String(body && body.continuation_ref || "").trim();
|