Skip to content

Commit f85dab5

Browse files
LinkCard.billingAddress type fix to reflect most attributes being optional
configure package to build exports when installed
1 parent adde79a commit f85dab5

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

lib/cards.js

+13-7
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,20 @@ export const CARD_VERIFICATION_STATUS = {
9292
*
9393
* @tag Cards
9494
*/
95+
96+
/** @template T
97+
* @template K {extends keyof T}
98+
* @typedef {Pick<Partial<T>, K> & Omit<T, K>} Optional
99+
*/
100+
95101
/**
96102
* Card information collected for acquisition.
97103
* @typedef LinkCard
98104
* @property {string} cardNumber - All digits of the card
99105
* @property {CardExpiration} expiration - Card expiration date
100106
* @property {string} cardCvv - 3-4 digit card verification value
101107
* @property {string} holderName - Full name of the card holder
102-
* @property {CardBillingAddress} billingAddress - The billing address of the card
108+
* @property {Optional<CardBillingAddress, 'addressLine1' | 'addressLine2' | 'city' | 'stateOrProvince' | 'country'>} billingAddress - The billing address of the card
103109
*
104110
* @tag Cards
105111
*/
@@ -141,7 +147,7 @@ export const CARD_VERIFICATION_STATUS = {
141147
* @property {CardVerficationStatuses} cardVerfication - The results of submitting cardholder data to a card network for verification
142148
* @property {string} issuer - The name of the issuer
143149
* @property {string} issuerCountry - The country of the issuer
144-
*
150+
*
145151
* @example
146152
* {
147153
"cardID": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
@@ -171,7 +177,7 @@ export const CARD_VERIFICATION_STATUS = {
171177
"issuer": "GRINGOTTS BANK",
172178
"issuerCountry": "US"
173179
}
174-
*
180+
*
175181
* @tag Cards
176182
*/
177183

@@ -187,7 +193,7 @@ export class Cards {
187193
/**
188194
* Retrieves details for the card with the specified ID.
189195
* The `CARDS_READ` scope enum is required when making a request from the browser.
190-
*
196+
*
191197
* @param {string} accountID - Account to query
192198
* @param {string} cardID - Card to query
193199
* @returns {Promise<Card>}
@@ -210,7 +216,7 @@ export class Cards {
210216
/**
211217
* Lists all the cards associated with a particular Moov account.
212218
* The `CARDS_READ` scope enum is required when making a request from the browser.
213-
*
219+
*
214220
* @param {string} accountID - Account to query
215221
* @returns {Promise<Card[]>}
216222
* @tag Cards
@@ -232,7 +238,7 @@ export class Cards {
232238
* Links a card to a Moov account. Only use this endpoint if you have provided Moov with a
233239
* copy of your PCI attestation of compliance.
234240
* The `CARDS_WRITE` scope enum is required when making a request from the browser.
235-
*
241+
*
236242
* @param {string} accountID - Account to link
237243
* @param {LinkCard} card - Card information
238244
* @returns {Promise<Card>}
@@ -256,7 +262,7 @@ export class Cards {
256262
/**
257263
* Disables a card with the specified ID.
258264
* The `CARDS_WRITE` scope enum is required when making a request from the browser.
259-
*
265+
*
260266
* @param {string} accountID - Account to query
261267
* @param {string} cardID - Card to query
262268
* @returns {Promise<void>}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"docs": "node ./scripts/generateDocs.cjs",
4141
"docs-watch": "watch \"npm run docs\" ./docs/templates",
4242
"docs-clean": "rm ./docs/output/*.*",
43+
"prepare": "npm run build",
4344
"test": "ava ./lib/**/*.test.js",
4445
"generate-types": "tsc",
4546
"test-watch": "ava --watch ./lib/**/*.test.js"

0 commit comments

Comments
 (0)