@visa/cli 4.1.0-rc.252 → 4.1.0-rc.254

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.
@@ -42,6 +42,11 @@ export type CliReviewInput = {
42
42
  cardLast4?: string;
43
43
  contact: Contact;
44
44
  approvalBaseUrl: string;
45
+ /**
46
+ * #8047: agent-authored purchase narrative captured at review time and
47
+ * replayed into the card draw's Transaction Intent Journal at pay time.
48
+ */
49
+ intentNarrative?: CardIntentNarrative;
45
50
  merchantName?: string;
46
51
  merchantCountryCode?: string;
47
52
  trustedMerchantIdentity?: Readonly<{
@@ -199,8 +204,24 @@ type Session = {
199
204
  currency: string;
200
205
  contact: Contact;
201
206
  agentJkt?: string;
207
+ /** #8047: narrative for this review's journal, carried review -> pay. */
208
+ intentNarrative?: CardIntentNarrative;
202
209
  cleanupTimer: ReturnType<typeof setTimeout>;
203
210
  };
211
+ /**
212
+ * #8047 Transaction Intent Journal narrative — the agent-authored half of the
213
+ * journal. Structural mirror of the CLI card client's `CardIntentNarrative`;
214
+ * the engine only threads it through and never interprets it.
215
+ */
216
+ export interface CardIntentNarrative {
217
+ userRequest: string;
218
+ product: string;
219
+ purpose?: string;
220
+ quantity?: number;
221
+ expectedResult?: string;
222
+ recurring?: boolean;
223
+ userIntentSalt?: string;
224
+ }
204
225
  export interface CardDrawVerdictDraw {
205
226
  tokenId: string;
206
227
  amount: string;
@@ -227,6 +248,8 @@ export interface CardDrawVerdictSeam {
227
248
  mandateId: string;
228
249
  drawId: string;
229
250
  draw: CardDrawVerdictDraw;
251
+ /** #8047: narrative the client turns into the draw's journal sidecar. */
252
+ intentNarrative?: CardIntentNarrative;
230
253
  }) => Promise<{
231
254
  verdict: string;
232
255
  remainingCents: number;
@@ -641,6 +641,7 @@ export function createCliCheckoutEngine(deps = {}) {
641
641
  currency: input.currency,
642
642
  contact: input.contact,
643
643
  ...(input.agentJkt ? { agentJkt: input.agentJkt } : {}),
644
+ ...(input.intentNarrative ? { intentNarrative: input.intentNarrative } : {}),
644
645
  cleanupTimer,
645
646
  });
646
647
  return {
@@ -945,6 +946,9 @@ export function createCliCheckoutEngine(deps = {}) {
945
946
  merchantUrl: session.target.merchantUrl,
946
947
  merchantCountryCode: session.target.merchantCountryCode,
947
948
  },
949
+ ...(session.intentNarrative
950
+ ? { intentNarrative: session.intentNarrative }
951
+ : {}),
948
952
  });
949
953
  confirmationAuthority = verdict;
950
954
  return fetchMandateCryptogram(confirmBase, verdict, i);