From 72e5fbbdb53d70652ecadeef496e6c58c3272790 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 23 May 2025 13:42:58 -0600 Subject: [PATCH] fix: endpoint used for UPS create/update --- CHANGELOG.md | 4 + package-lock.json | 4 +- package.json | 2 +- src/constants.js | 10 +- src/services/carrier_account_service.js | 29 +- .../recording.har | 58 ++-- .../recording.har | 260 ++++-------------- .../recording.har | 256 ++++------------- 8 files changed, 161 insertions(+), 462 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b29b83058..ffbe7a8e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v8.0.2 (2025-05-27) + +- Corrects the endpoint used for creating/updating UPS accounts + ## v8.0.1 (2025-05-08) - Fixes built distribution by removing reference to removed `repl` diff --git a/package-lock.json b/package-lock.json index ccf991c56..79cf70442 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@easypost/api", - "version": "8.0.1", + "version": "8.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@easypost/api", - "version": "8.0.1", + "version": "8.0.2", "license": "MIT", "dependencies": { "core-js": "~3.41", diff --git a/package.json b/package.json index fc7672c24..2ef170fda 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@easypost/api", "description": "EasyPost Node Client Library", - "version": "8.0.1", + "version": "8.0.2", "author": "Easypost Engineering ", "homepage": "https://easypost.com", "exports": { diff --git a/src/constants.js b/src/constants.js index 6d05f6a43..0e8122d64 100644 --- a/src/constants.js +++ b/src/constants.js @@ -7,11 +7,13 @@ export default class Constants { static get CARRIER_ACCOUNTS_WITH_CUSTOM_CREATE_WORKFLOWS() { return ['FedexAccount', 'FedexSmartpostAccount']; } - static get UPS_OAUTH_CARRIER_TYPES() { - return ['UpsAccount', 'UpsMailInnovationsAccount', 'UpsSurepostAccount']; - } static get CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH() { - return ['AmazonShippingAccount']; + return [ + 'AmazonShippingAccount', + 'UpsAccount', + 'UpsMailInnovationsAccount', + 'UpsSurepostAccount', + ]; } static EXTERNAL_API_CALL_FAILED = 'Communication with %s failed, please try again later'; static INVALID_API_KEY_TYPE = 'Invalid API key type.'; diff --git a/src/services/carrier_account_service.js b/src/services/carrier_account_service.js index df9879094..c1ae93bd7 100644 --- a/src/services/carrier_account_service.js +++ b/src/services/carrier_account_service.js @@ -39,15 +39,10 @@ export default (easypostClient) => * @returns {CarrierAccount} - The updated carrier account. */ static async update(id, params) { - const carrierAccount = await this.retrieve(id); - - const carrierAccountType = carrierAccount.type; - - const endpoint = this._selectCarrierAccountUpdateEndpoint(carrierAccountType, id); - const wrappedParams = this._wrapCarrierAccountParams(carrierAccountType, params); + const wrappedParams = { carrier_account: params }; try { - const response = await easypostClient._patch(endpoint, wrappedParams); + const response = await easypostClient._patch(`carrier_accounts/${id}`, wrappedParams); return this._convertToEasyPostObject(response.body, wrappedParams); } catch (e) { @@ -82,8 +77,6 @@ export default (easypostClient) => static _selectCarrierAccountCreationEndpoint(carrierAccountType) { if (Constants.CARRIER_ACCOUNTS_WITH_CUSTOM_CREATE_WORKFLOWS.includes(carrierAccountType)) { return 'carrier_accounts/register'; - } else if (Constants.UPS_OAUTH_CARRIER_TYPES.includes(carrierAccountType)) { - return 'ups_oauth_registrations'; } else if (Constants.CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH.includes(carrierAccountType)) { return 'carrier_accounts/register_oauth'; } @@ -91,20 +84,6 @@ export default (easypostClient) => return 'carrier_accounts'; } - /** - * Returns the correct carrier_account endpoint when updating a record based on the type. - * @private - * @param {string} carrierAccountType - The type of carrier account to be updated. - * @param {string} carrierAccountId - The ID of the carrier account to be updated. - * @returns {string} - The endpoint to be used for the carrier account update request. - */ - static _selectCarrierAccountUpdateEndpoint(carrierAccountType, carrierAccountId) { - if (Constants.UPS_OAUTH_CARRIER_TYPES.includes(carrierAccountType)) { - return `ups_oauth_registrations/${carrierAccountId}`; - } - return `carrier_accounts/${carrierAccountId}`; - } - /** * Wraps the carrier account parameters in the correct format based on the type. * @private @@ -113,9 +92,7 @@ export default (easypostClient) => * @returns {Object} - The wrapped carrier account parameters. */ static _wrapCarrierAccountParams(carrierAccountType, params) { - if (Constants.UPS_OAUTH_CARRIER_TYPES.includes(carrierAccountType)) { - return { ups_oauth_registrations: params }; - } else if (Constants.CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH.includes(carrierAccountType)) { + if (Constants.CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_OAUTH.includes(carrierAccountType)) { return { carrier_account_oauth_registrations: params }; } diff --git a/test/cassettes/CarrierAccount-Service_2076435725/creates-a-UPS-carrier-account_3537134608/recording.har b/test/cassettes/CarrierAccount-Service_2076435725/creates-a-UPS-carrier-account_3537134608/recording.har index 212037d9f..212013bb0 100644 --- a/test/cassettes/CarrierAccount-Service_2076435725/creates-a-UPS-carrier-account_3537134608/recording.har +++ b/test/cassettes/CarrierAccount-Service_2076435725/creates-a-UPS-carrier-account_3537134608/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "01fee270a4fb0bcbc78e2c11416157cc", + "_id": "51110e81f98cbbcf36e02d92b319e601", "_order": 0, "cache": {}, "request": { - "bodySize": 78, + "bodySize": 90, "cookies": [], "headers": [ { @@ -29,23 +29,23 @@ }, { "name": "content-length", - "value": 78 + "value": 90 }, { "name": "host", "value": "api.easypost.com" } ], - "headersSize": 404, + "headersSize": 413, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"ups_oauth_registrations\":{\"type\":\"UpsAccount\",\"account_number\":\"123456789\"}}" + "text": "{\"carrier_account_oauth_registrations\":{\"type\":\"UpsAccount\",\"account_number\":\"123456789\"}}" }, "queryString": [], - "url": "https://api.easypost.com/v2/ups_oauth_registrations" + "url": "https://api.easypost.com/v2/carrier_accounts/register_oauth" }, "response": { "bodySize": 884, @@ -53,7 +53,7 @@ "encoding": "base64", "mimeType": "application/json; charset=utf-8", "size": 884, - "text": "{\"id\":\"ca_56b9136b2fba405b8d45c09255e2fa6e\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:46Z\",\"updated_at\":\"2024-07-30T16:10:46Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" + "text": "{\"id\":\"ca_1de9af1b7f7742fbb7ed87d6118581bd\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:12Z\",\"updated_at\":\"2025-05-23T19:41:12Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" }, "cookies": [], "headers": [ @@ -83,7 +83,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a16f66a91086e2b873da003513e9" + "value": "6be4a8f26830cf58e787511e004703e4" }, { "name": "cache-control", @@ -103,7 +103,7 @@ }, { "name": "x-runtime", - "value": "0.089989" + "value": "0.242006" }, { "name": "content-encoding", @@ -115,23 +115,19 @@ }, { "name": "x-node", - "value": "bigweb32nuq" + "value": "bigweb53nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", "value": "easypost" }, - { - "name": "x-canary", - "value": "direct" - }, { "name": "x-proxied", - "value": "intlb3nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb1nuq 99aac35317" }, { "name": "strict-transport-security", @@ -142,14 +138,14 @@ "value": "close" } ], - "headersSize": 728, + "headersSize": 710, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 201, "statusText": "Created" }, - "startedDateTime": "2024-07-30T16:10:46.355Z", - "time": 194, + "startedDateTime": "2025-05-23T19:41:12.200Z", + "time": 754, "timings": { "blocked": -1, "connect": -1, @@ -157,11 +153,11 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 194 + "wait": 754 } }, { - "_id": "9f9d56cb9905559c7f64a248997b2df7", + "_id": "2afe2642013b64095187ead8e8aa23d9", "_order": 0, "cache": {}, "request": { @@ -185,11 +181,11 @@ "value": "api.easypost.com" } ], - "headersSize": 415, + "headersSize": 416, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_56b9136b2fba405b8d45c09255e2fa6e" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_1de9af1b7f7742fbb7ed87d6118581bd" }, "response": { "bodySize": 44, @@ -227,7 +223,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a17266a91086e2b873db00351414" + "value": "6be4a8f66830cf59e787511f00470478" }, { "name": "cache-control", @@ -247,7 +243,7 @@ }, { "name": "x-runtime", - "value": "0.065403" + "value": "0.064854" }, { "name": "content-encoding", @@ -259,11 +255,11 @@ }, { "name": "x-node", - "value": "bigweb41nuq" + "value": "bigweb53nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -271,7 +267,7 @@ }, { "name": "x-proxied", - "value": "intlb3nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb1nuq 99aac35317" }, { "name": "strict-transport-security", @@ -288,8 +284,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:46.553Z", - "time": 165, + "startedDateTime": "2025-05-23T19:41:12.958Z", + "time": 437, "timings": { "blocked": -1, "connect": -1, @@ -297,7 +293,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 165 + "wait": 437 } } ], diff --git a/test/cassettes/CarrierAccount-Service_2076435725/updates-a-UPS-carrier-account_2425174955/recording.har b/test/cassettes/CarrierAccount-Service_2076435725/updates-a-UPS-carrier-account_2425174955/recording.har index 1e80002e6..c0b3e18e2 100644 --- a/test/cassettes/CarrierAccount-Service_2076435725/updates-a-UPS-carrier-account_2425174955/recording.har +++ b/test/cassettes/CarrierAccount-Service_2076435725/updates-a-UPS-carrier-account_2425174955/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "01fee270a4fb0bcbc78e2c11416157cc", + "_id": "51110e81f98cbbcf36e02d92b319e601", "_order": 0, "cache": {}, "request": { - "bodySize": 78, + "bodySize": 90, "cookies": [], "headers": [ { @@ -29,31 +29,31 @@ }, { "name": "content-length", - "value": 78 + "value": 90 }, { "name": "host", "value": "api.easypost.com" } ], - "headersSize": 404, + "headersSize": 413, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"ups_oauth_registrations\":{\"type\":\"UpsAccount\",\"account_number\":\"123456789\"}}" + "text": "{\"carrier_account_oauth_registrations\":{\"type\":\"UpsAccount\",\"account_number\":\"123456789\"}}" }, "queryString": [], - "url": "https://api.easypost.com/v2/ups_oauth_registrations" + "url": "https://api.easypost.com/v2/carrier_accounts/register_oauth" }, "response": { - "bodySize": 872, + "bodySize": 892, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 872, - "text": "{\"id\":\"ca_8b71f2a511ee41c0a939859c2f3894fc\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:48Z\",\"updated_at\":\"2024-07-30T16:10:48Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" + "size": 892, + "text": "{\"id\":\"ca_8a327077162d441cb4f5073cf4ba1ca6\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:13Z\",\"updated_at\":\"2025-05-23T19:41:13Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" }, "cookies": [], "headers": [ @@ -83,7 +83,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a16c66a91088e2b873fc003515c9" + "value": "6ae239356830cf59e7875120008fa793" }, { "name": "cache-control", @@ -103,7 +103,7 @@ }, { "name": "x-runtime", - "value": "0.093430" + "value": "0.197170" }, { "name": "content-encoding", @@ -115,11 +115,11 @@ }, { "name": "x-node", - "value": "bigweb38nuq" + "value": "bigweb34nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -127,7 +127,7 @@ }, { "name": "x-proxied", - "value": "intlb3nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -144,8 +144,8 @@ "status": 201, "statusText": "Created" }, - "startedDateTime": "2024-07-30T16:10:48.304Z", - "time": 205, + "startedDateTime": "2025-05-23T19:41:13.481Z", + "time": 420, "timings": { "blocked": -1, "connect": -1, @@ -153,155 +153,15 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 205 + "wait": 420 } }, { - "_id": "9d366268890bceee6f5c330a590e5b54", + "_id": "78e5eb7356afeda24e761589f91357db", "_order": 0, "cache": {}, "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "name": "accept-encoding", - "value": "gzip, deflate" - }, - { - "name": "accept", - "value": "application/json" - }, - { - "name": "content-type", - "value": "application/json" - }, - { - "name": "host", - "value": "api.easypost.com" - } - ], - "headersSize": 412, - "httpVersion": "HTTP/1.1", - "method": "GET", - "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_8b71f2a511ee41c0a939859c2f3894fc" - }, - "response": { - "bodySize": 872, - "content": { - "encoding": "base64", - "mimeType": "application/json; charset=utf-8", - "size": 872, - "text": "{\"id\":\"ca_8b71f2a511ee41c0a939859c2f3894fc\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:48Z\",\"updated_at\":\"2024-07-30T16:10:48Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" - }, - "cookies": [], - "headers": [ - { - "name": "x-frame-options", - "value": "SAMEORIGIN" - }, - { - "name": "x-xss-protection", - "value": "1; mode=block" - }, - { - "name": "x-content-type-options", - "value": "nosniff" - }, - { - "name": "x-download-options", - "value": "noopen" - }, - { - "name": "x-permitted-cross-domain-policies", - "value": "none" - }, - { - "name": "referrer-policy", - "value": "strict-origin-when-cross-origin" - }, - { - "name": "x-ep-request-uuid", - "value": "6107a16f66a91088e2b873fd00351605" - }, - { - "name": "cache-control", - "value": "private, no-cache, no-store" - }, - { - "name": "pragma", - "value": "no-cache" - }, - { - "name": "expires", - "value": "0" - }, - { - "name": "content-type", - "value": "application/json; charset=utf-8" - }, - { - "name": "x-runtime", - "value": "0.034191" - }, - { - "name": "content-encoding", - "value": "gzip" - }, - { - "name": "transfer-encoding", - "value": "chunked" - }, - { - "name": "x-node", - "value": "bigweb53nuq" - }, - { - "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" - }, - { - "name": "x-backend", - "value": "easypost" - }, - { - "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" - }, - { - "name": "strict-transport-security", - "value": "max-age=31536000; includeSubDomains; preload" - }, - { - "name": "connection", - "value": "close" - } - ], - "headersSize": 710, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2024-07-30T16:10:48.513Z", - "time": 148, - "timings": { - "blocked": -1, - "connect": -1, - "dns": -1, - "receive": 0, - "send": 0, - "ssl": -1, - "wait": 148 - } - }, - { - "_id": "a2f50281bf3c7deee6fff84e3f7c3dc7", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 58, + "bodySize": 50, "cookies": [], "headers": [ { @@ -318,31 +178,31 @@ }, { "name": "content-length", - "value": 58 + "value": 50 }, { "name": "host", "value": "api.easypost.com" } ], - "headersSize": 441, + "headersSize": 435, "httpVersion": "HTTP/1.1", "method": "PATCH", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"ups_oauth_registrations\":{\"account_number\":\"987654321\"}}" + "text": "{\"carrier_account\":{\"account_number\":\"987654321\"}}" }, "queryString": [], - "url": "https://api.easypost.com/v2/ups_oauth_registrations/ca_8b71f2a511ee41c0a939859c2f3894fc" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_8a327077162d441cb4f5073cf4ba1ca6" }, "response": { - "bodySize": 876, + "bodySize": 892, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 876, - "text": "{\"id\":\"ca_8b71f2a511ee41c0a939859c2f3894fc\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:48Z\",\"updated_at\":\"2024-07-30T16:10:48Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" + "size": 892, + "text": "{\"id\":\"ca_8a327077162d441cb4f5073cf4ba1ca6\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:13Z\",\"updated_at\":\"2025-05-23T19:41:14Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" }, "cookies": [], "headers": [ @@ -372,7 +232,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a17366a91088e2b873fe00351633" + "value": "6ae239356830cf5ae7875121008fa808" }, { "name": "cache-control", @@ -392,7 +252,7 @@ }, { "name": "x-runtime", - "value": "0.081400" + "value": "0.075950" }, { "name": "content-encoding", @@ -404,11 +264,11 @@ }, { "name": "x-node", - "value": "bigweb42nuq" + "value": "bigweb57nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -416,7 +276,7 @@ }, { "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb4nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -433,8 +293,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:48.667Z", - "time": 185, + "startedDateTime": "2025-05-23T19:41:13.904Z", + "time": 300, "timings": { "blocked": -1, "connect": -1, @@ -442,12 +302,12 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 185 + "wait": 300 } }, { - "_id": "9d366268890bceee6f5c330a590e5b54", - "_order": 1, + "_id": "5c1daee36ba3f9193b2a0a57e6018516", + "_order": 0, "cache": {}, "request": { "bodySize": 0, @@ -470,19 +330,19 @@ "value": "api.easypost.com" } ], - "headersSize": 412, + "headersSize": 413, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_8b71f2a511ee41c0a939859c2f3894fc" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_8a327077162d441cb4f5073cf4ba1ca6" }, "response": { - "bodySize": 876, + "bodySize": 892, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 876, - "text": "{\"id\":\"ca_8b71f2a511ee41c0a939859c2f3894fc\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:48Z\",\"updated_at\":\"2024-07-30T16:10:48Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" + "size": 892, + "text": "{\"id\":\"ca_8a327077162d441cb4f5073cf4ba1ca6\",\"object\":\"CarrierAccount\",\"type\":\"UpsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:13Z\",\"updated_at\":\"2025-05-23T19:41:14Z\",\"description\":null,\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"UPS\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":null}" }, "cookies": [], "headers": [ @@ -512,7 +372,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a16d66a91088e2b873ff00351671" + "value": "6ae239336830cf5ae7875122008fa865" }, { "name": "cache-control", @@ -532,7 +392,7 @@ }, { "name": "x-runtime", - "value": "0.033448" + "value": "0.036330" }, { "name": "content-encoding", @@ -544,11 +404,11 @@ }, { "name": "x-node", - "value": "bigweb36nuq" + "value": "bigweb33nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -556,7 +416,7 @@ }, { "name": "x-proxied", - "value": "intlb3nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -573,8 +433,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:48.856Z", - "time": 136, + "startedDateTime": "2025-05-23T19:41:14.206Z", + "time": 245, "timings": { "blocked": -1, "connect": -1, @@ -582,11 +442,11 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 136 + "wait": 245 } }, { - "_id": "48c33b28d21be8d3a73e42597d1a0cb2", + "_id": "d5c92ce09e54eb123fbc8cacd8c68ec7", "_order": 0, "cache": {}, "request": { @@ -610,11 +470,11 @@ "value": "api.easypost.com" } ], - "headersSize": 415, + "headersSize": 416, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_8b71f2a511ee41c0a939859c2f3894fc" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_8a327077162d441cb4f5073cf4ba1ca6" }, "response": { "bodySize": 44, @@ -652,7 +512,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a17366a91089e2b8770e00351696" + "value": "6ae239346830cf5ae7875123008fa8b5" }, { "name": "cache-control", @@ -672,7 +532,7 @@ }, { "name": "x-runtime", - "value": "0.057500" + "value": "0.195624" }, { "name": "content-encoding", @@ -684,11 +544,11 @@ }, { "name": "x-node", - "value": "bigweb36nuq" + "value": "bigweb58nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -696,7 +556,7 @@ }, { "name": "x-proxied", - "value": "intlb3nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -713,8 +573,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:48.998Z", - "time": 171, + "startedDateTime": "2025-05-23T19:41:14.455Z", + "time": 410, "timings": { "blocked": -1, "connect": -1, @@ -722,7 +582,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 171 + "wait": 410 } } ], diff --git a/test/cassettes/CarrierAccount-Service_2076435725/updates-a-carrier-account_2644332837/recording.har b/test/cassettes/CarrierAccount-Service_2076435725/updates-a-carrier-account_2644332837/recording.har index ff9ea2a0b..155158a07 100644 --- a/test/cassettes/CarrierAccount-Service_2076435725/updates-a-carrier-account_2644332837/recording.har +++ b/test/cassettes/CarrierAccount-Service_2076435725/updates-a-carrier-account_2644332837/recording.har @@ -4,7 +4,7 @@ "creator": { "comment": "persister:fs", "name": "Polly.JS", - "version": "6.0.5" + "version": "6.0.6" }, "entries": [ { @@ -36,7 +36,7 @@ "value": "api.easypost.com" } ], - "headersSize": 398, + "headersSize": 399, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { @@ -48,12 +48,12 @@ "url": "https://api.easypost.com/v2/carrier_accounts" }, "response": { - "bodySize": 548, + "bodySize": 536, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 548, - "text": "{\"id\":\"ca_2b9bfcb9a5a549cf8c7913e08ab184d1\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:47Z\",\"updated_at\":\"2024-07-30T16:10:47Z\",\"description\":\"DHL eCommerce Solutions Account\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce Solutions\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" + "size": 536, + "text": "{\"id\":\"ca_7b6823b9b73648bd932b8d54125ce236\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:51Z\",\"updated_at\":\"2025-05-23T19:41:51Z\",\"description\":\"DHL eCommerce Account\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" }, "cookies": [], "headers": [ @@ -83,7 +83,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a17366a91087e2b873f7003514e7" + "value": "6ae239326830cf7fe7875125008fd371" }, { "name": "cache-control", @@ -103,7 +103,7 @@ }, { "name": "x-runtime", - "value": "0.062960" + "value": "0.072043" }, { "name": "content-encoding", @@ -115,23 +115,19 @@ }, { "name": "x-node", - "value": "bigweb43nuq" + "value": "bigweb35nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", "value": "easypost" }, - { - "name": "x-canary", - "value": "direct" - }, { "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb4nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -142,14 +138,14 @@ "value": "close" } ], - "headersSize": 728, + "headersSize": 710, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 201, "statusText": "Created" }, - "startedDateTime": "2024-07-30T16:10:47.421Z", - "time": 165, + "startedDateTime": "2025-05-23T19:41:51.424Z", + "time": 305, "timings": { "blocked": -1, "connect": -1, @@ -157,151 +153,11 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 165 + "wait": 305 } }, { - "_id": "508ff07327a8a53c5c6d234fb4c779d9", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "name": "accept-encoding", - "value": "gzip, deflate" - }, - { - "name": "accept", - "value": "application/json" - }, - { - "name": "content-type", - "value": "application/json" - }, - { - "name": "host", - "value": "api.easypost.com" - } - ], - "headersSize": 412, - "httpVersion": "HTTP/1.1", - "method": "GET", - "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_2b9bfcb9a5a549cf8c7913e08ab184d1" - }, - "response": { - "bodySize": 548, - "content": { - "encoding": "base64", - "mimeType": "application/json; charset=utf-8", - "size": 548, - "text": "{\"id\":\"ca_2b9bfcb9a5a549cf8c7913e08ab184d1\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:47Z\",\"updated_at\":\"2024-07-30T16:10:47Z\",\"description\":\"DHL eCommerce Solutions Account\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce Solutions\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" - }, - "cookies": [], - "headers": [ - { - "name": "x-frame-options", - "value": "SAMEORIGIN" - }, - { - "name": "x-xss-protection", - "value": "1; mode=block" - }, - { - "name": "x-content-type-options", - "value": "nosniff" - }, - { - "name": "x-download-options", - "value": "noopen" - }, - { - "name": "x-permitted-cross-domain-policies", - "value": "none" - }, - { - "name": "referrer-policy", - "value": "strict-origin-when-cross-origin" - }, - { - "name": "x-ep-request-uuid", - "value": "6107a17366a91087e2b873f800351519" - }, - { - "name": "cache-control", - "value": "private, no-cache, no-store" - }, - { - "name": "pragma", - "value": "no-cache" - }, - { - "name": "expires", - "value": "0" - }, - { - "name": "content-type", - "value": "application/json; charset=utf-8" - }, - { - "name": "x-runtime", - "value": "0.034142" - }, - { - "name": "content-encoding", - "value": "gzip" - }, - { - "name": "transfer-encoding", - "value": "chunked" - }, - { - "name": "x-node", - "value": "bigweb42nuq" - }, - { - "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" - }, - { - "name": "x-backend", - "value": "easypost" - }, - { - "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" - }, - { - "name": "strict-transport-security", - "value": "max-age=31536000; includeSubDomains; preload" - }, - { - "name": "connection", - "value": "close" - } - ], - "headersSize": 710, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2024-07-30T16:10:47.591Z", - "time": 148, - "timings": { - "blocked": -1, - "connect": -1, - "dns": -1, - "receive": 0, - "send": 0, - "ssl": -1, - "wait": 148 - } - }, - { - "_id": "99a7cf0c983d329dcd60181cde659531", + "_id": "c1a9d4e4c8921010cc6cbfa38fee7b6f", "_order": 0, "cache": {}, "request": { @@ -329,7 +185,7 @@ "value": "api.easypost.com" } ], - "headersSize": 434, + "headersSize": 435, "httpVersion": "HTTP/1.1", "method": "PATCH", "postData": { @@ -338,15 +194,15 @@ "text": "{\"carrier_account\":{\"description\":\"My custom description\"}}" }, "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_2b9bfcb9a5a549cf8c7913e08ab184d1" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_7b6823b9b73648bd932b8d54125ce236" }, "response": { - "bodySize": 556, + "bodySize": 552, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 556, - "text": "{\"id\":\"ca_2b9bfcb9a5a549cf8c7913e08ab184d1\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:47Z\",\"updated_at\":\"2024-07-30T16:10:47Z\",\"description\":\"My custom description\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce Solutions\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" + "size": 552, + "text": "{\"id\":\"ca_7b6823b9b73648bd932b8d54125ce236\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:51Z\",\"updated_at\":\"2025-05-23T19:41:52Z\",\"description\":\"My custom description\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" }, "cookies": [], "headers": [ @@ -376,7 +232,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a17166a91087e2b873f900351538" + "value": "6ae239396830cf7fe787513d008fd3e1" }, { "name": "cache-control", @@ -396,7 +252,7 @@ }, { "name": "x-runtime", - "value": "0.124311" + "value": "0.080998" }, { "name": "content-encoding", @@ -412,7 +268,7 @@ }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -420,7 +276,7 @@ }, { "name": "x-proxied", - "value": "intlb3nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb4nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -437,8 +293,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:47.747Z", - "time": 227, + "startedDateTime": "2025-05-23T19:41:51.734Z", + "time": 322, "timings": { "blocked": -1, "connect": -1, @@ -446,12 +302,12 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 227 + "wait": 322 } }, { - "_id": "508ff07327a8a53c5c6d234fb4c779d9", - "_order": 1, + "_id": "97556cc84ad9ca80c3e36e86f0dc41c7", + "_order": 0, "cache": {}, "request": { "bodySize": 0, @@ -474,19 +330,19 @@ "value": "api.easypost.com" } ], - "headersSize": 412, + "headersSize": 413, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_2b9bfcb9a5a549cf8c7913e08ab184d1" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_7b6823b9b73648bd932b8d54125ce236" }, "response": { - "bodySize": 556, + "bodySize": 552, "content": { "encoding": "base64", "mimeType": "application/json; charset=utf-8", - "size": 556, - "text": "{\"id\":\"ca_2b9bfcb9a5a549cf8c7913e08ab184d1\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2024-07-30T16:10:47Z\",\"updated_at\":\"2024-07-30T16:10:47Z\",\"description\":\"My custom description\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce Solutions\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" + "size": 552, + "text": "{\"id\":\"ca_7b6823b9b73648bd932b8d54125ce236\",\"object\":\"CarrierAccount\",\"type\":\"DhlEcsAccount\",\"clone\":false,\"created_at\":\"2025-05-23T19:41:51Z\",\"updated_at\":\"2025-05-23T19:41:52Z\",\"description\":\"My custom description\",\"reference\":null,\"billing_type\":\"carrier\",\"readable\":\"DHL eCommerce\",\"logo\":null,\"fields\":[],\"credentials\":{},\"test_credentials\":{}}" }, "cookies": [], "headers": [ @@ -516,7 +372,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a17266a91088e2b873fa00351575" + "value": "6ae239376830cf80e787513e008fd435" }, { "name": "cache-control", @@ -536,7 +392,7 @@ }, { "name": "x-runtime", - "value": "0.031485" + "value": "0.075399" }, { "name": "content-encoding", @@ -548,11 +404,11 @@ }, { "name": "x-node", - "value": "bigweb34nuq" + "value": "bigweb42nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", @@ -560,7 +416,7 @@ }, { "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -577,8 +433,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:47.981Z", - "time": 132, + "startedDateTime": "2025-05-23T19:41:52.060Z", + "time": 322, "timings": { "blocked": -1, "connect": -1, @@ -586,11 +442,11 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 132 + "wait": 322 } }, { - "_id": "fd2810750434a0633738bbe451e99ae5", + "_id": "c27be03cf5e44946fa58589270b2ce45", "_order": 0, "cache": {}, "request": { @@ -614,11 +470,11 @@ "value": "api.easypost.com" } ], - "headersSize": 415, + "headersSize": 416, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.easypost.com/v2/carrier_accounts/ca_2b9bfcb9a5a549cf8c7913e08ab184d1" + "url": "https://api.easypost.com/v2/carrier_accounts/ca_7b6823b9b73648bd932b8d54125ce236" }, "response": { "bodySize": 44, @@ -656,7 +512,7 @@ }, { "name": "x-ep-request-uuid", - "value": "6107a16c66a91088e2b873fb0035159f" + "value": "6ae239336830cf80e787513f008fd49c" }, { "name": "cache-control", @@ -676,7 +532,7 @@ }, { "name": "x-runtime", - "value": "0.063743" + "value": "0.059562" }, { "name": "content-encoding", @@ -688,19 +544,23 @@ }, { "name": "x-node", - "value": "bigweb38nuq" + "value": "bigweb32nuq" }, { "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" + "value": "easypost-202505231841-d89645a184-master" }, { "name": "x-backend", "value": "easypost" }, + { + "name": "x-canary", + "value": "direct" + }, { "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" + "value": "intlb3nuq 668d3fc830, extlb2nuq 99aac35317" }, { "name": "strict-transport-security", @@ -711,14 +571,14 @@ "value": "close" } ], - "headersSize": 710, + "headersSize": 728, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2024-07-30T16:10:48.118Z", - "time": 175, + "startedDateTime": "2025-05-23T19:41:52.386Z", + "time": 310, "timings": { "blocked": -1, "connect": -1, @@ -726,7 +586,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 175 + "wait": 310 } } ],