From 6851408db8f38588eb64c9fa1b7ce258ea12b1f4 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 23 Nov 2026 22:07:49 +0000 Subject: [PATCH 1/4] Update verification input documentation `true` now means that your system considers the email address or phone number verified as of the time of the event. `false` means that it is not verified, for any reason. Before, the documentation said not to set the value if no verification was attempted. Set the verification time only with `true`. If your system does not track verification, leave the value unset. STF-2488 Co-Authored-By: Claude Fable 5.2 --- CHANGELOG.md | 11 +++++++++++ src/constants.ts | 2 +- src/request/email.ts | 42 +++++++++++++++++++++++++++-------------- src/request/location.ts | 24 ++++++++++++++++------- 4 files changed, 57 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f4dabeb..41f30e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ CHANGELOG ========= +9.2.2 (unreleased) +------------------ + +* Updated the documentation for the email and phone verification inputs. Set + `wasVerificationSuccessful` and `phoneWasVerificationSuccessful` to `true` + if your system considers the email address or phone number verified as of + the time of the event. Set them to `false` if it is not verified, for + example if its only verification is pending or failed. If your system does + not track verification, leave them unset. Set a verification time only when + the value is `true`. There are no code changes. + 9.2.1 (2026-11-18) ------------------ diff --git a/src/constants.ts b/src/constants.ts index a73a6f79..0addccf9 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -28,7 +28,7 @@ export enum DeliverySpeed { export enum PhoneVerificationMethod { /** * A one-time code delivered to the phone number by SMS, an automated voice - * call, or a messaging app, and entered by the user. + * call, or a messaging app, for the user to enter. */ DeliveredCode = 'delivered_code', /** diff --git a/src/request/email.ts b/src/request/email.ts index 7e0f51ef..3f7ee6ef 100644 --- a/src/request/email.ts +++ b/src/request/email.ts @@ -53,16 +53,23 @@ interface EmailProps { */ hashAddress?: boolean; /** - * The date and time of the most recent attempt to verify the email address, - * if known. The time must not be before 1970-01-01T00:00:00Z or more than two - * days in the future. The web service ignores a time outside this range and - * returns a warning. + * The date and time that the end user completed the most recent verification + * of the email address, if known. Set this only if + * `wasVerificationSuccessful` is `true`. The time must not be before + * 1970-01-01T00:00:00Z or more than two days in the future. The web service + * ignores a time outside this range and returns a warning. */ verificationTime?: Date; /** - * Whether the most recent verification that the end user controls the email - * address succeeded, for example by confirming a link sent to the address. - * Omit this if no verification was attempted. + * Whether the end user has verified that they control the email address, as + * of the time of the event, for example by confirming a link sent to the + * address. Set this to `true` if your system considers the email address + * verified as of the time of the event. An earlier completed verification + * still counts, even if a newer attempt is pending or failed. Set it to + * `false` if the email address is not verified. This includes one whose only + * verification is pending or failed, and one that you did not try to verify. + * Omitting this is not equivalent to `false`. If your system does not track + * email verification, omit this. */ wasVerificationSuccessful?: boolean; } @@ -79,16 +86,23 @@ export default class Email implements EmailProps { /** @inheritDoc EmailProps.domain */ public domain?: string; /** - * The date and time of the most recent attempt to verify the email address, - * if known. The time must not be before 1970-01-01T00:00:00Z or more than two - * days in the future. The web service ignores a time outside this range and - * returns a warning. + * The date and time that the end user completed the most recent verification + * of the email address, if known. Set this only if + * `wasVerificationSuccessful` is `true`. The time must not be before + * 1970-01-01T00:00:00Z or more than two days in the future. The web service + * ignores a time outside this range and returns a warning. */ public verificationTime?: Date; /** - * Whether the most recent verification that the end user controls the email - * address succeeded, for example by confirming a link sent to the address. - * Omit this if no verification was attempted. + * Whether the end user has verified that they control the email address, as + * of the time of the event, for example by confirming a link sent to the + * address. Set this to `true` if your system considers the email address + * verified as of the time of the event. An earlier completed verification + * still counts, even if a newer attempt is pending or failed. Set it to + * `false` if the email address is not verified. This includes one whose only + * verification is pending or failed, and one that you did not try to verify. + * Omitting this is not equivalent to `false`. If your system does not track + * email verification, omit this. */ public wasVerificationSuccessful?: boolean; diff --git a/src/request/location.ts b/src/request/location.ts index d14db010..d8abb0b0 100644 --- a/src/request/location.ts +++ b/src/request/location.ts @@ -49,19 +49,29 @@ export interface LocationProps { */ phoneCountryCode?: string; /** - * The most recent method used to verify the phone number. + * The method used for the most recent completed verification of the phone + * number. If the phone number is not verified, you can set the method of the + * most recent attempt if your system records it. Do not set this if you did + * not try to verify the phone number. */ phoneVerificationMethod?: PhoneVerificationMethod; /** - * The date and time of the most recent verification of the phone number. - * The time must not be before 1970-01-01T00:00:00Z or more than two days in - * the future. The web service ignores a time outside this range and returns - * a warning. + * The date and time that the end user completed the most recent verification + * of the phone number, if known. Set this only if + * `phoneWasVerificationSuccessful` is `true`. The time must not be before + * 1970-01-01T00:00:00Z or more than two days in the future. The web service + * ignores a time outside this range and returns a warning. */ phoneVerificationTime?: Date; /** - * Whether the most recent verification of the phone number succeeded. Omit - * this if no verification was attempted. + * Whether the end user has verified that they control the phone number, as of + * the time of the event. Set this to `true` if your system considers the + * phone number verified as of the time of the event. An earlier completed + * verification still counts, even if a newer attempt is pending or failed. + * Set it to `false` if the phone number is not verified. This includes one + * whose only verification is pending or failed, and one that you did not try + * to verify. Omitting this is not equivalent to `false`. If your system does + * not track phone verification, omit this. */ phoneWasVerificationSuccessful?: boolean; } From caa38f18367ee30a7646229fb716f6ea9a995ff3 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 23 Nov 2026 23:12:50 +0000 Subject: [PATCH 2/4] Export request property types The request classes inherit their property descriptions from the `*Props` interfaces with `@inheritDoc`. TypeDoc could not resolve those references because the package root did not export the interfaces. The docs build printed 86 "Failed to find" warnings and the API documentation showed no description for those properties. STF-2488 Co-Authored-By: Claude Fable 5.2 --- CHANGELOG.md | 10 ++++++++-- src/index.ts | 12 ++++++++++++ src/request/account.ts | 2 +- src/request/device.ts | 2 +- src/request/email.ts | 2 +- src/request/event.ts | 2 +- src/request/order.ts | 2 +- src/request/payment.ts | 2 +- src/request/shipping.ts | 2 +- src/request/shopping-cart-item.ts | 2 +- src/request/transaction-report.ts | 2 +- 11 files changed, 29 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f30e13..a3292766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ CHANGELOG ========= -9.2.2 (unreleased) +9.3.0 (unreleased) ------------------ * Updated the documentation for the email and phone verification inputs. Set @@ -10,7 +10,13 @@ CHANGELOG the time of the event. Set them to `false` if it is not verified, for example if its only verification is pending or failed. If your system does not track verification, leave them unset. Set a verification time only when - the value is `true`. There are no code changes. + the value is `true`. +* Exported the request property types from the package root: `AccountProps`, + `CreditCardProps`, `DeviceProps`, `EmailProps`, `EventProps`, + `LocationProps`, `OrderProps`, `PaymentProps`, `ShippingProps`, + `ShoppingCartItemProps`, `TransactionProps`, and `TransactionReportProps`. + The API documentation now shows the descriptions of the request properties + that inherit them from these types. 9.2.1 (2026-11-18) ------------------ diff --git a/src/index.ts b/src/index.ts index 993522bb..1572120c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,18 @@ export { WebServiceError, }; +export type { AccountProps } from './request/account.js'; +export type { CreditCardProps } from './request/credit-card.js'; +export type { DeviceProps } from './request/device.js'; +export type { EmailProps } from './request/email.js'; +export type { EventProps } from './request/event.js'; +export type { LocationProps } from './request/location.js'; +export type { OrderProps } from './request/order.js'; +export type { PaymentProps } from './request/payment.js'; +export type { ShippingProps } from './request/shipping.js'; +export type { ShoppingCartItemProps } from './request/shopping-cart-item.js'; +export type { TransactionProps } from './request/transaction.js'; +export type { TransactionReportProps } from './request/transaction-report.js'; export type { ClientErrorCode, WebServiceClientError, diff --git a/src/request/account.ts b/src/request/account.ts index db02c5de..ab200050 100644 --- a/src/request/account.ts +++ b/src/request/account.ts @@ -1,6 +1,6 @@ import crypto from 'node:crypto'; -interface AccountProps { +export interface AccountProps { /** * A unique user ID associated with the end-user in your system. If your * system allows the login name for the account to be changed, this should diff --git a/src/request/device.ts b/src/request/device.ts index 3964c575..394ad29b 100644 --- a/src/request/device.ts +++ b/src/request/device.ts @@ -1,7 +1,7 @@ import { isIP } from 'node:net'; import { ArgumentError } from '../errors.js'; -interface DeviceProps { +export interface DeviceProps { /** * The IP address associated with the device used by the customer in the * transaction. diff --git a/src/request/email.ts b/src/request/email.ts index 3f7ee6ef..8c59b6b7 100644 --- a/src/request/email.ts +++ b/src/request/email.ts @@ -38,7 +38,7 @@ const isEmail = (value: string): boolean => { return match !== null && isFQDN(match[2]); }; -interface EmailProps { +export interface EmailProps { /** * The email address used in the transaction. */ diff --git a/src/request/event.ts b/src/request/event.ts index fc75648a..6789c15c 100644 --- a/src/request/event.ts +++ b/src/request/event.ts @@ -1,7 +1,7 @@ import { EventParty, EventType } from '../constants.js'; import { assertValidDate } from '../utils.js'; -interface EventProps { +export interface EventProps { /** * The party submitting the transaction. */ diff --git a/src/request/order.ts b/src/request/order.ts index 48fdf3e9..a950ec4d 100644 --- a/src/request/order.ts +++ b/src/request/order.ts @@ -1,7 +1,7 @@ import { isIP } from 'node:net'; import { ArgumentError } from '../errors.js'; -interface OrderProps { +export interface OrderProps { /** * The total order amount for the transaction. */ diff --git a/src/request/payment.ts b/src/request/payment.ts index 3e874f7b..4fc7e707 100644 --- a/src/request/payment.ts +++ b/src/request/payment.ts @@ -1,6 +1,6 @@ import { PaymentMethod, Processor } from '../constants.js'; -interface PaymentProps { +export interface PaymentProps { /** * The payment method associated with the transaction. */ diff --git a/src/request/shipping.ts b/src/request/shipping.ts index 36697cef..edc4ffe5 100644 --- a/src/request/shipping.ts +++ b/src/request/shipping.ts @@ -1,7 +1,7 @@ import { DeliverySpeed } from '../constants.js'; import Location, { LocationProps } from './location.js'; -interface ShippingProps extends LocationProps { +export interface ShippingProps extends LocationProps { /** * The shipping delivery speed for the order. */ diff --git a/src/request/shopping-cart-item.ts b/src/request/shopping-cart-item.ts index 39cf2c38..eb8ae9e3 100644 --- a/src/request/shopping-cart-item.ts +++ b/src/request/shopping-cart-item.ts @@ -1,6 +1,6 @@ import { ArgumentError } from '../errors.js'; -interface ShoppingCartItemProps { +export interface ShoppingCartItemProps { /** * The category of the item. */ diff --git a/src/request/transaction-report.ts b/src/request/transaction-report.ts index f45f2092..136a788c 100644 --- a/src/request/transaction-report.ts +++ b/src/request/transaction-report.ts @@ -3,7 +3,7 @@ import { Tag } from '../constants.js'; import { ArgumentError } from '../errors.js'; import { snakecaseKeys } from '../utils.js'; -interface TransactionReportProps { +export interface TransactionReportProps { /** * A string which is provided by your payment processor indicating the * reason for the chargeback. From d9e5de02c1dfe90e66b08bd758a453a6fe58526b Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 23 Nov 2026 23:12:50 +0000 Subject: [PATCH 3/4] Keep comments in the build output `removeComments` stripped the documentation comments from the `.d.ts` files, so editors showed no description for any property. The build output grows from about 76 kB to about 136 kB. STF-2488 Co-Authored-By: Claude Fable 5.2 --- CHANGELOG.md | 2 ++ tsconfig.json | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3292766..23fd7186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ CHANGELOG `ShoppingCartItemProps`, `TransactionProps`, and `TransactionReportProps`. The API documentation now shows the descriptions of the request properties that inherit them from these types. +* The package now keeps the documentation comments in its type declarations, + so editors show them. 9.2.1 (2026-11-18) ------------------ diff --git a/tsconfig.json b/tsconfig.json index d93f2d84..f8f4d3c0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,6 @@ "moduleResolution": "NodeNext", "outDir": "dist", "pretty": true, - "removeComments": true, "resolveJsonModule": true, "skipLibCheck": true, "strict": true, From 5e0845180835e0e9d1edfb8711767a7135a5d42c Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 30 Nov 2026 20:45:44 +0000 Subject: [PATCH 4/4] Inherit the Email verification comments The `Email` class repeated the full text of the `verificationTime` and `wasVerificationSuccessful` comments from `EmailProps`. It now uses `@inheritDoc`, as `domain` does, so the text has one source. STF-2488 Co-Authored-By: Claude Fable 5.2 --- src/request/email.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/request/email.ts b/src/request/email.ts index 8c59b6b7..41dcf7d8 100644 --- a/src/request/email.ts +++ b/src/request/email.ts @@ -85,25 +85,9 @@ export default class Email implements EmailProps { public address?: string; /** @inheritDoc EmailProps.domain */ public domain?: string; - /** - * The date and time that the end user completed the most recent verification - * of the email address, if known. Set this only if - * `wasVerificationSuccessful` is `true`. The time must not be before - * 1970-01-01T00:00:00Z or more than two days in the future. The web service - * ignores a time outside this range and returns a warning. - */ + /** @inheritDoc EmailProps.verificationTime */ public verificationTime?: Date; - /** - * Whether the end user has verified that they control the email address, as - * of the time of the event, for example by confirming a link sent to the - * address. Set this to `true` if your system considers the email address - * verified as of the time of the event. An earlier completed verification - * still counts, even if a newer attempt is pending or failed. Set it to - * `false` if the email address is not verified. This includes one whose only - * verification is pending or failed, and one that you did not try to verify. - * Omitting this is not equivalent to `false`. If your system does not track - * email verification, omit this. - */ + /** @inheritDoc EmailProps.wasVerificationSuccessful */ public wasVerificationSuccessful?: boolean; private static readonly typoDomains: { [key: string]: string } = {