Skip to content

Commit

Permalink
LinkCard.billingAddress type fix to reflect most attributes being opt…
Browse files Browse the repository at this point in the history
…ional

configure package to build exports when installed
  • Loading branch information
curiousercreative committed Feb 7, 2024
1 parent adde79a commit f85dab5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lib/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@ export const CARD_VERIFICATION_STATUS = {
*
* @tag Cards
*/

/** @template T
* @template K {extends keyof T}
* @typedef {Pick<Partial<T>, K> & Omit<T, K>} Optional
*/

/**
* Card information collected for acquisition.
* @typedef LinkCard
* @property {string} cardNumber - All digits of the card
* @property {CardExpiration} expiration - Card expiration date
* @property {string} cardCvv - 3-4 digit card verification value
* @property {string} holderName - Full name of the card holder
* @property {CardBillingAddress} billingAddress - The billing address of the card
* @property {Optional<CardBillingAddress, 'addressLine1' | 'addressLine2' | 'city' | 'stateOrProvince' | 'country'>} billingAddress - The billing address of the card
*
* @tag Cards
*/
Expand Down Expand Up @@ -141,7 +147,7 @@ export const CARD_VERIFICATION_STATUS = {
* @property {CardVerficationStatuses} cardVerfication - The results of submitting cardholder data to a card network for verification
* @property {string} issuer - The name of the issuer
* @property {string} issuerCountry - The country of the issuer
*
*
* @example
* {
"cardID": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
Expand Down Expand Up @@ -171,7 +177,7 @@ export const CARD_VERIFICATION_STATUS = {
"issuer": "GRINGOTTS BANK",
"issuerCountry": "US"
}
*
*
* @tag Cards
*/

Expand All @@ -187,7 +193,7 @@ export class Cards {
/**
* Retrieves details for the card with the specified ID.
* The `CARDS_READ` scope enum is required when making a request from the browser.
*
*
* @param {string} accountID - Account to query
* @param {string} cardID - Card to query
* @returns {Promise<Card>}
Expand All @@ -210,7 +216,7 @@ export class Cards {
/**
* Lists all the cards associated with a particular Moov account.
* The `CARDS_READ` scope enum is required when making a request from the browser.
*
*
* @param {string} accountID - Account to query
* @returns {Promise<Card[]>}
* @tag Cards
Expand All @@ -232,7 +238,7 @@ export class Cards {
* Links a card to a Moov account. Only use this endpoint if you have provided Moov with a
* copy of your PCI attestation of compliance.
* The `CARDS_WRITE` scope enum is required when making a request from the browser.
*
*
* @param {string} accountID - Account to link
* @param {LinkCard} card - Card information
* @returns {Promise<Card>}
Expand All @@ -256,7 +262,7 @@ export class Cards {
/**
* Disables a card with the specified ID.
* The `CARDS_WRITE` scope enum is required when making a request from the browser.
*
*
* @param {string} accountID - Account to query
* @param {string} cardID - Card to query
* @returns {Promise<void>}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"docs": "node ./scripts/generateDocs.cjs",
"docs-watch": "watch \"npm run docs\" ./docs/templates",
"docs-clean": "rm ./docs/output/*.*",
"prepare": "npm run build",
"test": "ava ./lib/**/*.test.js",
"generate-types": "tsc",
"test-watch": "ava --watch ./lib/**/*.test.js"
Expand Down

0 comments on commit f85dab5

Please sign in to comment.