@tokenoftrust/cli 7.5.9 → 7.5.10
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/package.json +1 -1
- package/src/commands/go-live.mjs +19 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.10",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/commands/go-live.mjs
CHANGED
|
@@ -142,7 +142,7 @@ export function normalizeReadiness(r) {
|
|
|
142
142
|
* The server's `checkoutPaymentReadiness` (live checkout posture), or null when the worker does
|
|
143
143
|
* not send it. Informational: it never gates the apex cutover. Pure.
|
|
144
144
|
* @param {any} raw
|
|
145
|
-
* @returns {{ ready: boolean, posture: string, detail: string, remedy: string, providerSync: { status: "in-sync"|"drifted", drift: string[] } | null } | null}
|
|
145
|
+
* @returns {{ ready: boolean, posture: string, detail: string, remedy: string, providerSync: { status: "in-sync"|"drifted", drift: string[] } | null, providerHandshake: { status: "ready"|"issues", issues: string[] } | null } | null}
|
|
146
146
|
*/
|
|
147
147
|
export function normalizeCheckoutPaymentReadiness(raw) {
|
|
148
148
|
if (!raw || typeof raw !== "object") return null;
|
|
@@ -156,12 +156,24 @@ export function normalizeCheckoutPaymentReadiness(raw) {
|
|
|
156
156
|
: [],
|
|
157
157
|
}
|
|
158
158
|
: null;
|
|
159
|
+
const hs = raw.providerHandshake && typeof raw.providerHandshake === "object" ? raw.providerHandshake : null;
|
|
160
|
+
const providerHandshake =
|
|
161
|
+
hs && (hs.status === "ready" || hs.status === "issues")
|
|
162
|
+
? {
|
|
163
|
+
status: hs.status,
|
|
164
|
+
issues:
|
|
165
|
+
hs.handshake && Array.isArray(hs.handshake.issues)
|
|
166
|
+
? hs.handshake.issues.filter((i) => typeof i === "string" && i.length > 0)
|
|
167
|
+
: [],
|
|
168
|
+
}
|
|
169
|
+
: null;
|
|
159
170
|
return {
|
|
160
171
|
ready: raw.readyForLiveOrders === true,
|
|
161
172
|
posture: typeof raw.posture === "string" ? raw.posture : "unknown",
|
|
162
173
|
detail: typeof raw.detail === "string" ? raw.detail : "",
|
|
163
174
|
remedy: typeof raw.remedy === "string" ? raw.remedy : "",
|
|
164
175
|
providerSync,
|
|
176
|
+
providerHandshake,
|
|
165
177
|
};
|
|
166
178
|
}
|
|
167
179
|
|
|
@@ -291,7 +303,12 @@ export function renderReadiness({ appDomain, readiness, action }) {
|
|
|
291
303
|
? "provider in sync"
|
|
292
304
|
: `provider drifted: ${payment.providerSync.drift.join(", ")}`
|
|
293
305
|
: "";
|
|
294
|
-
const
|
|
306
|
+
const handshakeDetail = payment.providerHandshake
|
|
307
|
+
? payment.providerHandshake.status === "ready"
|
|
308
|
+
? "webhooks & gateway verified"
|
|
309
|
+
: `webhook/gateway issues: ${payment.providerHandshake.issues.join(", ")}`
|
|
310
|
+
: "";
|
|
311
|
+
const paymentDetail = [payment.detail, syncDetail, handshakeDetail].filter(Boolean).join("; ");
|
|
295
312
|
lines.push(` ${payment.ready ? "✓" : "✗"} Live payments${paymentDetail ? ` — ${paymentDetail}` : ""}`);
|
|
296
313
|
if (!payment.ready && payment.remedy) lines.push(` → ${payment.remedy}`);
|
|
297
314
|
}
|