@tokenoftrust/cli 7.5.8 → 7.5.9
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 +34 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.9",
|
|
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,15 +142,26 @@ 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 } | null}
|
|
145
|
+
* @returns {{ ready: boolean, posture: string, detail: string, remedy: string, providerSync: { status: "in-sync"|"drifted", drift: string[] } | null } | null}
|
|
146
146
|
*/
|
|
147
147
|
export function normalizeCheckoutPaymentReadiness(raw) {
|
|
148
148
|
if (!raw || typeof raw !== "object") return null;
|
|
149
|
+
const sync = raw.providerSync && typeof raw.providerSync === "object" ? raw.providerSync : null;
|
|
150
|
+
const providerSync =
|
|
151
|
+
sync && (sync.status === "in-sync" || sync.status === "drifted")
|
|
152
|
+
? {
|
|
153
|
+
status: sync.status,
|
|
154
|
+
drift: Array.isArray(sync.drift)
|
|
155
|
+
? sync.drift.map((d) => (d && typeof d.field === "string" ? d.field : null)).filter(Boolean)
|
|
156
|
+
: [],
|
|
157
|
+
}
|
|
158
|
+
: null;
|
|
149
159
|
return {
|
|
150
160
|
ready: raw.readyForLiveOrders === true,
|
|
151
161
|
posture: typeof raw.posture === "string" ? raw.posture : "unknown",
|
|
152
162
|
detail: typeof raw.detail === "string" ? raw.detail : "",
|
|
153
163
|
remedy: typeof raw.remedy === "string" ? raw.remedy : "",
|
|
164
|
+
providerSync,
|
|
154
165
|
};
|
|
155
166
|
}
|
|
156
167
|
|
|
@@ -185,6 +196,17 @@ export function normalizeDispatch(r) {
|
|
|
185
196
|
runId: typeof o.runId === "string" ? o.runId : null,
|
|
186
197
|
error: typeof o.error === "string" ? o.error : null,
|
|
187
198
|
domain: o.domain && typeof o.domain === "object" ? o.domain : null,
|
|
199
|
+
checkoutProviderConvergence:
|
|
200
|
+
o.checkoutProviderConvergence && typeof o.checkoutProviderConvergence === "object"
|
|
201
|
+
? {
|
|
202
|
+
outcome:
|
|
203
|
+
typeof o.checkoutProviderConvergence.outcome === "string" ? o.checkoutProviderConvergence.outcome : null,
|
|
204
|
+
storeDomain:
|
|
205
|
+
typeof o.checkoutProviderConvergence.storeDomain === "string"
|
|
206
|
+
? o.checkoutProviderConvergence.storeDomain
|
|
207
|
+
: null,
|
|
208
|
+
}
|
|
209
|
+
: null,
|
|
188
210
|
};
|
|
189
211
|
}
|
|
190
212
|
|
|
@@ -264,7 +286,13 @@ export function renderReadiness({ appDomain, readiness, action }) {
|
|
|
264
286
|
}
|
|
265
287
|
const payment = readiness.checkoutPaymentReadiness;
|
|
266
288
|
if (payment && payment.posture !== "no-checkout") {
|
|
267
|
-
|
|
289
|
+
const syncDetail = payment.providerSync
|
|
290
|
+
? payment.providerSync.status === "in-sync"
|
|
291
|
+
? "provider in sync"
|
|
292
|
+
: `provider drifted: ${payment.providerSync.drift.join(", ")}`
|
|
293
|
+
: "";
|
|
294
|
+
const paymentDetail = [payment.detail, syncDetail].filter(Boolean).join("; ");
|
|
295
|
+
lines.push(` ${payment.ready ? "✓" : "✗"} Live payments${paymentDetail ? ` — ${paymentDetail}` : ""}`);
|
|
268
296
|
if (!payment.ready && payment.remedy) lines.push(` → ${payment.remedy}`);
|
|
269
297
|
}
|
|
270
298
|
if (action === "connect") {
|
|
@@ -523,6 +551,10 @@ function rehearsalSetupLines(dnsSetup) {
|
|
|
523
551
|
export function reportGoLive({ status, dispatch, action, rehearsal, domain, noOpen, openUrl, dnsSetup }) {
|
|
524
552
|
const runUrl = status?.runUrl || null;
|
|
525
553
|
const revertHint = " Revert (one line): tot go-live --rollback";
|
|
554
|
+
if (dispatch?.checkoutProviderConvergence?.outcome === "converged") {
|
|
555
|
+
const store = dispatch.checkoutProviderConvergence.storeDomain;
|
|
556
|
+
console.log(`\n ✓ checkout provider converged${store ? ` on ${store}` : ""} — the dedicated store matches your checkout configuration.`);
|
|
557
|
+
}
|
|
526
558
|
|
|
527
559
|
if (status?.status === "succeeded") {
|
|
528
560
|
if (rehearsal) {
|