@tokenoftrust/cli 7.5.8 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/cli",
3
- "version": "7.5.8",
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",
@@ -142,15 +142,38 @@ 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, 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;
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;
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;
149
170
  return {
150
171
  ready: raw.readyForLiveOrders === true,
151
172
  posture: typeof raw.posture === "string" ? raw.posture : "unknown",
152
173
  detail: typeof raw.detail === "string" ? raw.detail : "",
153
174
  remedy: typeof raw.remedy === "string" ? raw.remedy : "",
175
+ providerSync,
176
+ providerHandshake,
154
177
  };
155
178
  }
156
179
 
@@ -185,6 +208,17 @@ export function normalizeDispatch(r) {
185
208
  runId: typeof o.runId === "string" ? o.runId : null,
186
209
  error: typeof o.error === "string" ? o.error : null,
187
210
  domain: o.domain && typeof o.domain === "object" ? o.domain : null,
211
+ checkoutProviderConvergence:
212
+ o.checkoutProviderConvergence && typeof o.checkoutProviderConvergence === "object"
213
+ ? {
214
+ outcome:
215
+ typeof o.checkoutProviderConvergence.outcome === "string" ? o.checkoutProviderConvergence.outcome : null,
216
+ storeDomain:
217
+ typeof o.checkoutProviderConvergence.storeDomain === "string"
218
+ ? o.checkoutProviderConvergence.storeDomain
219
+ : null,
220
+ }
221
+ : null,
188
222
  };
189
223
  }
190
224
 
@@ -264,7 +298,18 @@ export function renderReadiness({ appDomain, readiness, action }) {
264
298
  }
265
299
  const payment = readiness.checkoutPaymentReadiness;
266
300
  if (payment && payment.posture !== "no-checkout") {
267
- lines.push(` ${payment.ready ? "✓" : "✗"} Live payments${payment.detail ? ` — ${payment.detail}` : ""}`);
301
+ const syncDetail = payment.providerSync
302
+ ? payment.providerSync.status === "in-sync"
303
+ ? "provider in sync"
304
+ : `provider drifted: ${payment.providerSync.drift.join(", ")}`
305
+ : "";
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("; ");
312
+ lines.push(` ${payment.ready ? "✓" : "✗"} Live payments${paymentDetail ? ` — ${paymentDetail}` : ""}`);
268
313
  if (!payment.ready && payment.remedy) lines.push(` → ${payment.remedy}`);
269
314
  }
270
315
  if (action === "connect") {
@@ -523,6 +568,10 @@ function rehearsalSetupLines(dnsSetup) {
523
568
  export function reportGoLive({ status, dispatch, action, rehearsal, domain, noOpen, openUrl, dnsSetup }) {
524
569
  const runUrl = status?.runUrl || null;
525
570
  const revertHint = " Revert (one line): tot go-live --rollback";
571
+ if (dispatch?.checkoutProviderConvergence?.outcome === "converged") {
572
+ const store = dispatch.checkoutProviderConvergence.storeDomain;
573
+ console.log(`\n ✓ checkout provider converged${store ? ` on ${store}` : ""} — the dedicated store matches your checkout configuration.`);
574
+ }
526
575
 
527
576
  if (status?.status === "succeeded") {
528
577
  if (rehearsal) {