xytara 1.23.0 → 1.24.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
|
@@ -235,6 +235,15 @@ The current `1.23.0` line starts turning that adapter-reliable operating interfa
|
|
|
235
235
|
|
|
236
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
237
|
|
|
238
|
+
The current `1.24.0` line starts turning that adapter-integrable operating path into a clearer adapter-ready default path:
|
|
239
|
+
|
|
240
|
+
- operating-path summaries on top of the default operating-integration path
|
|
241
|
+
- compact operating-path bundles for direct adapter-facing default-path posture
|
|
242
|
+
- default operating-path summaries for the next proof-side operating-path run posture
|
|
243
|
+
- clearer operating-path ids and stable default-path carry
|
|
244
|
+
|
|
245
|
+
This is intended to make the transaction-side continuation path easier to use as the obvious first public adapter path instead of only a path that is integrable with a little extra coordination.
|
|
246
|
+
|
|
238
247
|
## Package Surface
|
|
239
248
|
|
|
240
249
|
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
|
@@ -4920,6 +4920,54 @@ class CommerceClient {
|
|
|
4920
4920
|
});
|
|
4921
4921
|
}
|
|
4922
4922
|
|
|
4923
|
+
async prepareInteractionResultPackageOperatingPathSummary(continuationRef, body, options) {
|
|
4924
|
+
const opts = options || {};
|
|
4925
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-path-summary", {
|
|
4926
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.path.summary",
|
|
4927
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4928
|
+
body: body || {},
|
|
4929
|
+
callback_url: opts.callbackUrl || null,
|
|
4930
|
+
settlement_mode: opts.settlementMode || null,
|
|
4931
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4932
|
+
protocol: opts.protocol || null,
|
|
4933
|
+
integration_id: opts.integrationId || null,
|
|
4934
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4935
|
+
integration_context: opts.integrationContext || null
|
|
4936
|
+
});
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
async prepareInteractionResultPackageOperatingPathBundle(continuationRef, body, options) {
|
|
4940
|
+
const opts = options || {};
|
|
4941
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-path-bundle", {
|
|
4942
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.path.bundle",
|
|
4943
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4944
|
+
body: body || {},
|
|
4945
|
+
callback_url: opts.callbackUrl || null,
|
|
4946
|
+
settlement_mode: opts.settlementMode || null,
|
|
4947
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4948
|
+
protocol: opts.protocol || null,
|
|
4949
|
+
integration_id: opts.integrationId || null,
|
|
4950
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4951
|
+
integration_context: opts.integrationContext || null
|
|
4952
|
+
});
|
|
4953
|
+
}
|
|
4954
|
+
|
|
4955
|
+
async prepareInteractionResultPackageOperatingPathDefaultSummary(continuationRef, body, options) {
|
|
4956
|
+
const opts = options || {};
|
|
4957
|
+
return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/operating-path-default-summary", {
|
|
4958
|
+
command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.operating.path.default.summary",
|
|
4959
|
+
continuation_ref: String(continuationRef || "").trim(),
|
|
4960
|
+
body: body || {},
|
|
4961
|
+
callback_url: opts.callbackUrl || null,
|
|
4962
|
+
settlement_mode: opts.settlementMode || null,
|
|
4963
|
+
payment_protocol: opts.paymentProtocol || null,
|
|
4964
|
+
protocol: opts.protocol || null,
|
|
4965
|
+
integration_id: opts.integrationId || null,
|
|
4966
|
+
integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
|
|
4967
|
+
integration_context: opts.integrationContext || null
|
|
4968
|
+
});
|
|
4969
|
+
}
|
|
4970
|
+
|
|
4923
4971
|
async runNamedTaskRoute(path, payload) {
|
|
4924
4972
|
if (!this.apiKey || !this.walletId || !this.walletSecret) {
|
|
4925
4973
|
throw new Error("named task routes require apiKey, walletId, and walletSecret");
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1828,6 +1828,58 @@ function buildPreparedContinuationDefaultOperatingIntegrationSummary(portableHan
|
|
|
1828
1828
|
};
|
|
1829
1829
|
}
|
|
1830
1830
|
|
|
1831
|
+
function buildPreparedContinuationAdapterDefaultOperatingPathSummary(portableHandoff, continuation) {
|
|
1832
|
+
const operatingIntegration = buildPreparedContinuationDefaultOperatingIntegrationSummary(portableHandoff, continuation);
|
|
1833
|
+
return {
|
|
1834
|
+
ok: operatingIntegration.ok === true,
|
|
1835
|
+
default_operating_integration_ref: operatingIntegration.default_operating_integration_ref || null,
|
|
1836
|
+
operating_path_ref: operatingIntegration.default_operating_integration_ref
|
|
1837
|
+
? `path.${operatingIntegration.default_operating_integration_ref}`
|
|
1838
|
+
: null,
|
|
1839
|
+
default_operating_path_ids: Array.isArray(operatingIntegration.stable_default_operating_integration_ids)
|
|
1840
|
+
? operatingIntegration.stable_default_operating_integration_ids
|
|
1841
|
+
: [],
|
|
1842
|
+
operating_path_carry: operatingIntegration.default_operating_integration_carry || {},
|
|
1843
|
+
adapter_ready_by_default: operatingIntegration.operating_integration_integrable_by_default === true,
|
|
1844
|
+
next_surface: "/v1/proof-center/result-package-handoff/review/operating-path"
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
function buildPreparedContinuationAdapterDefaultOperatingPathBundle(portableHandoff, continuation) {
|
|
1849
|
+
const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
|
|
1850
|
+
const summary = buildPreparedContinuationAdapterDefaultOperatingPathSummary(portableHandoff, continuation);
|
|
1851
|
+
return {
|
|
1852
|
+
ok: true,
|
|
1853
|
+
operating_path_summary: summary,
|
|
1854
|
+
operating_path_template: {
|
|
1855
|
+
ok: true,
|
|
1856
|
+
operating_path_ref: summary.operating_path_ref || null,
|
|
1857
|
+
target_surface: "/v1/proof-center/result-package-handoff/review/operating-path",
|
|
1858
|
+
request_template: {
|
|
1859
|
+
handoff_bundle: handoff
|
|
1860
|
+
},
|
|
1861
|
+
stable_boundary_ids: Array.isArray(summary.default_operating_path_ids) ? summary.default_operating_path_ids : []
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
function buildPreparedContinuationDefaultOperatingPathRunSummary(portableHandoff, continuation) {
|
|
1867
|
+
const operatingPath = buildPreparedContinuationAdapterDefaultOperatingPathSummary(portableHandoff, continuation);
|
|
1868
|
+
return {
|
|
1869
|
+
ok: operatingPath.ok === true,
|
|
1870
|
+
operating_path_ref: operatingPath.operating_path_ref || null,
|
|
1871
|
+
default_operating_path_ref: operatingPath.operating_path_ref
|
|
1872
|
+
? `default.${operatingPath.operating_path_ref}`
|
|
1873
|
+
: null,
|
|
1874
|
+
stable_default_operating_path_ids: Array.isArray(operatingPath.default_operating_path_ids)
|
|
1875
|
+
? operatingPath.default_operating_path_ids
|
|
1876
|
+
: [],
|
|
1877
|
+
default_operating_path_carry: operatingPath.operating_path_carry || {},
|
|
1878
|
+
operating_path_ready_by_default: operatingPath.adapter_ready_by_default === true,
|
|
1879
|
+
next_surface: "/v1/proof-center/result-package-handoff/review/operating-path-run"
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1831
1883
|
function buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation) {
|
|
1832
1884
|
const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
|
|
1833
1885
|
return {
|
|
@@ -3825,6 +3877,99 @@ async function routeRequest(req, res) {
|
|
|
3825
3877
|
return;
|
|
3826
3878
|
}
|
|
3827
3879
|
|
|
3880
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-path-summary") {
|
|
3881
|
+
const body = await readJsonBody(req);
|
|
3882
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3883
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3884
|
+
if (!continuation) {
|
|
3885
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3886
|
+
return;
|
|
3887
|
+
}
|
|
3888
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3889
|
+
if (!resultPackage) {
|
|
3890
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3891
|
+
return;
|
|
3892
|
+
}
|
|
3893
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3894
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3895
|
+
spine_path_ref: resultPackage.source_ref
|
|
3896
|
+
});
|
|
3897
|
+
if (!payload) {
|
|
3898
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3899
|
+
return;
|
|
3900
|
+
}
|
|
3901
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3902
|
+
if (result.status !== 200) {
|
|
3903
|
+
sendJson(res, result.status, result.payload);
|
|
3904
|
+
return;
|
|
3905
|
+
}
|
|
3906
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3907
|
+
sendJson(res, 200, buildPreparedContinuationAdapterDefaultOperatingPathSummary(portableHandoff, continuation));
|
|
3908
|
+
return;
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-path-bundle") {
|
|
3912
|
+
const body = await readJsonBody(req);
|
|
3913
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3914
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3915
|
+
if (!continuation) {
|
|
3916
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3917
|
+
return;
|
|
3918
|
+
}
|
|
3919
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3920
|
+
if (!resultPackage) {
|
|
3921
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3922
|
+
return;
|
|
3923
|
+
}
|
|
3924
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3925
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3926
|
+
spine_path_ref: resultPackage.source_ref
|
|
3927
|
+
});
|
|
3928
|
+
if (!payload) {
|
|
3929
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3930
|
+
return;
|
|
3931
|
+
}
|
|
3932
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3933
|
+
if (result.status !== 200) {
|
|
3934
|
+
sendJson(res, result.status, result.payload);
|
|
3935
|
+
return;
|
|
3936
|
+
}
|
|
3937
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3938
|
+
sendJson(res, 200, buildPreparedContinuationAdapterDefaultOperatingPathBundle(portableHandoff, continuation));
|
|
3939
|
+
return;
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/operating-path-default-summary") {
|
|
3943
|
+
const body = await readJsonBody(req);
|
|
3944
|
+
const continuationRef = String(body && body.continuation_ref || "").trim();
|
|
3945
|
+
const continuation = getInteractionResultPackageContinuation(continuationRef);
|
|
3946
|
+
if (!continuation) {
|
|
3947
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3948
|
+
return;
|
|
3949
|
+
}
|
|
3950
|
+
const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
|
|
3951
|
+
if (!resultPackage) {
|
|
3952
|
+
sendJson(res, 404, { ok: false, error: "result_package_not_found" });
|
|
3953
|
+
return;
|
|
3954
|
+
}
|
|
3955
|
+
const payload = buildInteractionSpinePathRunPayload({
|
|
3956
|
+
...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
|
|
3957
|
+
spine_path_ref: resultPackage.source_ref
|
|
3958
|
+
});
|
|
3959
|
+
if (!payload) {
|
|
3960
|
+
sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
|
|
3961
|
+
return;
|
|
3962
|
+
}
|
|
3963
|
+
const result = executeCommandRequest(state, payload, req.headers);
|
|
3964
|
+
if (result.status !== 200) {
|
|
3965
|
+
sendJson(res, result.status, result.payload);
|
|
3966
|
+
return;
|
|
3967
|
+
}
|
|
3968
|
+
const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
|
|
3969
|
+
sendJson(res, 200, buildPreparedContinuationDefaultOperatingPathRunSummary(portableHandoff, continuation));
|
|
3970
|
+
return;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3828
3973
|
if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/contract-template") {
|
|
3829
3974
|
const body = await readJsonBody(req);
|
|
3830
3975
|
const continuationRef = String(body && body.continuation_ref || "").trim();
|