Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrub cassettes #253

Merged
merged 3 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
],
"require": [
"@babel/register",
"./test/common.js"
"./test/helpers/common.js"
]
}
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint": "eslint src test",
"prepublishOnly": "npm run clean && npm run build && npm run test && npm run lint && npm run check",
"repl": "./repl.js --local easypost.js",
"test": "cross-env NODE_ENV=test mocha --timeout 10000 --require @babel/register --require ./test/common.js --recursive ./test",
"test": "cross-env NODE_ENV=test mocha --timeout 10000 --require @babel/register --require ./test/helpers/common.js --recursive ./test",
"watch": "webpack --config webpack.config.babel.js --watch"
},
"dependencies": {
Expand All @@ -49,9 +49,9 @@
"@babel/preset-env": "^7.16.11",
"@babel/register": "^7.17.0",
"@easypost/eslint-config-easypost-base": "~2.2.3",
"@pollyjs/adapter-node-http": "^6.0.4",
"@pollyjs/core": "^6.0.4",
"@pollyjs/persister-fs": "^6.0.4",
"@pollyjs/adapter-node-http": "^6.0.5",
"@pollyjs/core": "^6.0.5",
"@pollyjs/persister-fs": "^6.0.5",
"babel-loader": "~8.2.3",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-transform-export-extensions": "^6.22.0",
Expand Down
2 changes: 1 addition & 1 deletion src/beta/resources/referral.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function sendCardDetailsToStripe(stripeKey, number, expirationMonth, expir
* Send the Stripe credit card token to EasyPost to add the card to the user's account.
* @param {API} api - The API client to use.
* @param {string} referralApiKey - The referral user's production API key.
* @param {string} stripeCreditCardId - Stripe credit card ID.
* @param {string} stripeCreditCardToken - Stripe credit card token.
* @param {string} priority - Whether to add the card as the 'primary' or 'secondary' card.
* @returns {Object} - Response body (EasyPost payment method object).
*/
Expand Down
1 change: 0 additions & 1 deletion src/easypost.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const EASYPOST_UA_HEADER = 'X-EasyPost-Client-User-Agent';

export const DEFAULT_HEADERS = {
Accept: 'application/json',
'Accept-Encoding': 'gzip,deflate,sdch,br',
'Content-Type': 'application/json',
'User-Agent': `EasyPost/v2 NodejsClient/${pkg.version} Nodejs/${process.versions.node}`,
[EASYPOST_UA_HEADER]: JSON.stringify(UA_INFO),
Expand Down
1 change: 1 addition & 0 deletions src/resources/shipment.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const propTypes = {
customs_info: T.oneOfType([T.string, T.shape(customsInfoPropTypes)]),
carrier_accounts: T.arrayOf(T.string),
carrier_account: T.string,
carrier: T.string,
scan_form: T.oneOfType([T.string, T.object]),
forms: T.array,
insurance: T.oneOfType([T.string, T.shape(insurancePropTypes)]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.4"
"version": "6.0.5"
},
"entries": [
{
"_id": "1e768552834ce0b898c153a397142aea",
"_id": "e1ba2611ac1d4d93e09871de492d2580",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -17,7 +17,7 @@
"headers": [
{
"name": "accept-encoding",
"value": "gzip,deflate,sdch,br"
"value": "gzip, deflate"
},
{
"name": "accept",
Expand All @@ -27,14 +27,6 @@
"name": "content-type",
"value": "application/json"
},
{
"name": "user-agent",
"value": "EasyPost/v2 NodejsClient/4.0.0 Nodejs/17.8.0"
},
{
"name": "x-easypost-client-user-agent",
"value": "{\"client_version\":\"4.0.0\",\"lang\":\"nodejs\",\"lang_version\":\"v17.8.0\",\"publisher\":\"easypost\",\"platform\":\"darwin\"}"
},
{
"name": "content-length",
"value": 189
Expand All @@ -44,7 +36,7 @@
"value": "api.easypost.com"
}
],
"headersSize": 518,
"headersSize": 511,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
Expand All @@ -56,12 +48,12 @@
"url": "https://api.easypost.com/v2/addresses/create_and_verify"
},
"response": {
"bodySize": 672,
"bodySize": 676,
"content": {
"encoding": "base64",
"mimeType": "application/json; charset=utf-8",
"size": 672,
"text": "[\"H4sIAAAAAAAAA9SSQY+bMBCF/wpyL61KsjaBZOGGskmFlEAV0kpRVSEHD6krYyJjVs1G+987Jtkeeuq1XGAe7w2fZ7gSLoSBvifJlUhBEqxNNY9EDByiYzQLGYP6GNOG16yZHymnggHxSXf8CbVFf3rP+6Q2wC2Iijs5oEEwoeGERvtgllCWRPFHShNK0Ticxb8ZNW+BJHpQCrt37ZnrCyZWaXn4XJR7NPTWAFiGYsgW3rbI95+K7Wp38Mq9t9540R9LgBaHKK3rUKa5t96l+TIrl8XoQR7UlykWL/KMj3HIEIqxIHaxbtDWuOSXEsvzj07D+M2IBbMwmi9QhJZL9QbbdsIZLPTWxbkxEkyFM5RqJLi5cG5SgLaSY7DhqgefNCDAcFVZ/qty+7g5R8C/tGcwspE1t7LT4/oQPHT3fqjrcaPWDNgRjOkMVt+ueI4RazUtV8sif0p3hyrL18Vum+6zIp9m+dd0kz0hcSNBuZ/hbXh4IuzITy6d6WeupPB6qDstuLl4UjedaUeQ9+nZPpSDtPDugxvscDrhDPDFjfr1u08EWJxUfxdcrSSe5fI/oV+JwowdHNNsMV3EszDwier06S5OWBBMQxo8PvrEyhaql9svk7a4tZo/bLq+SvUJFPTk1V2/AQAA//8DACQsSHiJAwAA\"]"
"size": 676,
"text": "{\"address\":{\"id\":\"adr_ba5f7ea6e1e311ecadcaac1f6bc72124\",\"object\":\"Address\",\"created_at\":\"2022-06-01T19:47:54+00:00\",\"updated_at\":\"2022-06-01T19:47:54+00:00\",\"name\":null,\"company\":\"EASYPOST\",\"street1\":\"417 MONTGOMERY ST FL 5\",\"street2\":\"\",\"city\":\"SAN FRANCISCO\",\"state\":\"CA\",\"zip\":\"94104-1129\",\"country\":\"US\",\"phone\":\"4151234567\",\"email\":null,\"mode\":\"test\",\"carrier_facility\":null,\"residential\":false,\"federal_tax_id\":null,\"state_tax_id\":null,\"verifications\":{\"zip4\":{\"success\":true,\"errors\":[{\"code\":\"E.SECONDARY_INFORMATION.INVALID\",\"field\":\"street2\",\"message\":\"Invalid secondary information(Apt/Suite#)\",\"suggestion\":null}],\"details\":null},\"delivery\":{\"success\":true,\"errors\":[{\"code\":\"E.SECONDARY_INFORMATION.INVALID\",\"field\":\"street2\",\"message\":\"Invalid secondary information(Apt/Suite#)\",\"suggestion\":null}],\"details\":{\"latitude\":37.79342,\"longitude\":-122.40288,\"time_zone\":\"America/Los_Angeles\"}}}}}"
},
"cookies": [],
"headers": [
Expand Down Expand Up @@ -91,7 +83,7 @@
},
{
"name": "x-ep-request-uuid",
"value": "911d659d624cca67e78751a40037ed99"
"value": "f5a1f0486297c26ae786c07b00096615"
},
{
"name": "cache-control",
Expand All @@ -107,19 +99,19 @@
},
{
"name": "location",
"value": "/api/v2/addresses/adr_65d9eae5b53411ecb90fac1f6b0a0d1e"
"value": "/api/v2/addresses/adr_ba5f7ea6e1e311ecadcaac1f6bc72124"
},
{
"name": "content-type",
"value": "application/json; charset=utf-8"
},
{
"name": "etag",
"value": "W/\"d0bb6695e46efba7376b6db4f6941f98\""
"value": "W/\"07191f3fda4ea36f55dc7517082ff505\""
},
{
"name": "x-runtime",
"value": "0.053672"
"value": "0.044259"
},
{
"name": "content-encoding",
Expand All @@ -131,19 +123,19 @@
},
{
"name": "x-node",
"value": "bigweb4nuq"
"value": "bigweb2nuq"
},
{
"name": "x-version-label",
"value": "easypost-202204052211-71ac4481b7-master"
"value": "easypost-202206011908-268b477d75-master"
},
{
"name": "x-backend",
"value": "easypost"
},
{
"name": "x-proxied",
"value": "intlb1nuq fde591f008, extlb2nuq fde591f008"
"value": "intlb2nuq 570dfcbc0a, extlb2nuq 0910011e7e"
},
{
"name": "strict-transport-security",
Expand All @@ -156,20 +148,20 @@
],
"headersSize": 810,
"httpVersion": "HTTP/1.1",
"redirectURL": "/api/v2/addresses/adr_65d9eae5b53411ecb90fac1f6b0a0d1e",
"redirectURL": "/api/v2/addresses/adr_ba5f7ea6e1e311ecadcaac1f6bc72124",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2022-04-05T23:01:59.036Z",
"time": 238,
"startedDateTime": "2022-06-01T19:47:53.961Z",
"time": 237,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 238
"wait": 237
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.4"
"version": "6.0.5"
},
"entries": [
{
"_id": "d4d1b31f54de5c440927760c22d641b3",
"_id": "d49186dfee05ff144349a18686106454",
"_order": 0,
"cache": {},
"request": {
Expand All @@ -17,7 +17,7 @@
"headers": [
{
"name": "accept-encoding",
"value": "gzip,deflate,sdch,br"
"value": "gzip, deflate"
},
{
"name": "accept",
Expand All @@ -27,14 +27,6 @@
"name": "content-type",
"value": "application/json"
},
{
"name": "user-agent",
"value": "EasyPost/v2 NodejsClient/5.1.0 Nodejs/16.13.1"
},
{
"name": "x-easypost-client-user-agent",
"value": "{\"client_version\":\"5.1.0\",\"lang\":\"nodejs\",\"lang_version\":\"v16.13.1\",\"publisher\":\"easypost\",\"platform\":\"darwin\"}"
},
{
"name": "content-length",
"value": 189
Expand All @@ -44,7 +36,7 @@
"value": "api.easypost.com"
}
],
"headersSize": 502,
"headersSize": 493,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
Expand All @@ -61,7 +53,7 @@
"encoding": "base64",
"mimeType": "application/json; charset=utf-8",
"size": 672,
"text": "[\"H4sIAAAAAAAAA9SST4+bMBDFvwpyL62aZLH5k4QbyiYVUgJVSFeKqgp58ZC6MiYyZtVstN+9Y7LbQ097LReYx3vjn8e+EilIQrgwFQ1YEC2CWERxTCnUy4ByXtMmfqznjLKQTEj3+Atqi/5UCAN9j1JtgFsQFXcy8xmb+tGUxgfGErpIKPvs+4nvo3E4i/cZNW+BJHpQCrt37ZnrCybWaXn8WpQHNPTWAFiKYkjn3q7ID1+K3Xp/9MqDt9l60V8LQ4tDlNZ1KNPc2+zTfJWVq2L0IA/qqxSLZ3nGz2VI/XBKKVu6WDdoa1zyW4nl+WenYVwzoiwIo3iOIrRcqjfYthPOYKG3Ls6NkWCqhtdSjQQ3F85NCtBWcgw2XPUwIQ0IMFxVlv+u3HncnCPgP9oTGNnImlvZ6Z4kVwceunc/1LU7kcSaATuCMZ3B6vsV9zFirWflelXk9+n+WGX5ptjv0kNW5LMsf0i32T0SNxKUuwxvw8MdYUd+culMP3ElhddD3WnBzcWTuulMO4J8TM/2rhykhQ+f3GCH0wlngD9u1C8/JkSAxUn1r4KrlcS9XP4n9CtRmLGDYwrms/kyCNmEqE6fXsUpZWwW+myxmBArW6ieb1cmbfHUan637foq1SdQ0JMXfP4AAAD//wMAdzGsSX0DAAA=\"]"
"text": "{\"id\":\"adr_b99daccbe1e311ec9429ac1f6bc7b362\",\"object\":\"Address\",\"created_at\":\"2022-06-01T19:47:52+00:00\",\"updated_at\":\"2022-06-01T19:47:52+00:00\",\"name\":null,\"company\":\"EASYPOST\",\"street1\":\"417 MONTGOMERY ST FL 5\",\"street2\":\"\",\"city\":\"SAN FRANCISCO\",\"state\":\"CA\",\"zip\":\"94104-1129\",\"country\":\"US\",\"phone\":\"<REDACTED>\",\"email\":null,\"mode\":\"test\",\"carrier_facility\":null,\"residential\":false,\"federal_tax_id\":null,\"state_tax_id\":null,\"verifications\":{\"zip4\":{\"success\":true,\"errors\":[{\"code\":\"E.SECONDARY_INFORMATION.INVALID\",\"field\":\"street2\",\"message\":\"Invalid secondary information(Apt/Suite#)\",\"suggestion\":null}],\"details\":null},\"delivery\":{\"success\":true,\"errors\":[{\"code\":\"E.SECONDARY_INFORMATION.INVALID\",\"field\":\"street2\",\"message\":\"Invalid secondary information(Apt/Suite#)\",\"suggestion\":null}],\"details\":{\"latitude\":37.79342,\"longitude\":-122.40288,\"time_zone\":\"America/Los_Angeles\"}}}}"
},
"cookies": [],
"headers": [
Expand Down Expand Up @@ -91,7 +83,7 @@
},
{
"name": "x-ep-request-uuid",
"value": "a65f33796282cda4ff02f75f00143e25"
"value": "f5a1f0476297c268e786c05f0009656e"
},
{
"name": "cache-control",
Expand All @@ -107,19 +99,19 @@
},
{
"name": "location",
"value": "/api/v2/addresses/adr_13235836d56611ec931aac1f6bc72124"
"value": "/api/v2/addresses/adr_b99daccbe1e311ec9429ac1f6bc7b362"
},
{
"name": "content-type",
"value": "application/json; charset=utf-8"
},
{
"name": "etag",
"value": "W/\"baa51597d0261a04580941b4cf83ae1a\""
"value": "W/\"8cd09111b7715ac226dcf843edbdc421\""
},
{
"name": "x-runtime",
"value": "0.043986"
"value": "0.041234"
},
{
"name": "content-encoding",
Expand All @@ -131,19 +123,19 @@
},
{
"name": "x-node",
"value": "bigweb6nuq"
"value": "bigweb5nuq"
},
{
"name": "x-version-label",
"value": "easypost-202205161937-fdfdac8556-master"
"value": "easypost-202206011908-268b477d75-master"
},
{
"name": "x-backend",
"value": "easypost"
},
{
"name": "x-proxied",
"value": "intlb2nuq 570dfcbc0a, extlb1nuq c51cdb8bf2"
"value": "intlb1nuq 570dfcbc0a, extlb2nuq 0910011e7e"
},
{
"name": "strict-transport-security",
Expand All @@ -156,20 +148,20 @@
],
"headersSize": 810,
"httpVersion": "HTTP/1.1",
"redirectURL": "/api/v2/addresses/adr_13235836d56611ec931aac1f6bc72124",
"redirectURL": "/api/v2/addresses/adr_b99daccbe1e311ec9429ac1f6bc7b362",
"status": 201,
"statusText": "Created"
},
"startedDateTime": "2022-05-16T22:18:12.235Z",
"time": 273,
"startedDateTime": "2022-06-01T19:47:52.697Z",
"time": 234,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 273
"wait": 234
}
}
],
Expand Down
Loading