From f00f3374bc4cb7c70f5994a85ce00f375b904386 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Mon, 23 Sep 2024 11:53:47 -0600 Subject: [PATCH] chore: remove tracker create_list endpoint function --- CHANGELOG.md | 4 + src/services/tracker_service.js | 12 -- .../recording.har | 167 ------------------ test/services/tracker.test.js | 13 -- 4 files changed, 4 insertions(+), 192 deletions(-) delete mode 100644 test/cassettes/Tracker-Service_4233073632/creates-trackers-in-bulk-from-a-list-of-tracking-codes_1298478007/recording.har diff --git a/CHANGELOG.md b/CHANGELOG.md index f71fcfcd6..8483794f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Next Release + +- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API + ## v7.5.2 (2024-08-16) - Fixes webhook validation when the `weight` field contains a float by converting it back into a float after conversion from a string (closes #467) diff --git a/src/services/tracker_service.js b/src/services/tracker_service.js index 0b554c8c0..0c3997b95 100644 --- a/src/services/tracker_service.js +++ b/src/services/tracker_service.js @@ -22,18 +22,6 @@ export default (easypostClient) => return this._create(url, wrappedParams); } - /** - * Create multiple {@link Tracker trackers} in a single request. - * See {@link https://www.easypost.com/docs/api/node#trackers EasyPost API Documentation} for more information. - * @param {Object} [params] - The parameters to create trackers with. - * @deprecated Use the create function instead. createList will be removed in a future version. - */ - static async createList(params = {}) { - const newParams = { trackers: params }; - const url = 'trackers/create_list'; - await easypostClient._post(url, newParams); - } - /** * Retrieve all {@link Tracker trackers} associated with the current authenticated user. * See {@link https://www.easypost.com/docs/api/node#retrieve-a-list-of-trackers EasyPost API Documentation} for more information. diff --git a/test/cassettes/Tracker-Service_4233073632/creates-trackers-in-bulk-from-a-list-of-tracking-codes_1298478007/recording.har b/test/cassettes/Tracker-Service_4233073632/creates-trackers-in-bulk-from-a-list-of-tracking-codes_1298478007/recording.har deleted file mode 100644 index b3b158f02..000000000 --- a/test/cassettes/Tracker-Service_4233073632/creates-trackers-in-bulk-from-a-list-of-tracking-codes_1298478007/recording.har +++ /dev/null @@ -1,167 +0,0 @@ -{ - "log": { - "_recordingName": "Tracker Service/creates trackers in bulk from a list of tracking codes", - "creator": { - "comment": "persister:fs", - "name": "Polly.JS", - "version": "6.0.5" - }, - "entries": [ - { - "_id": "9252bfb04f6d18a2b537767d5e87570a", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 162, - "cookies": [], - "headers": [ - { - "name": "accept-encoding", - "value": "gzip, deflate" - }, - { - "name": "accept", - "value": "application/json" - }, - { - "name": "content-type", - "value": "application/json" - }, - { - "name": "content-length", - "value": 162 - }, - { - "name": "host", - "value": "api.easypost.com" - } - ], - "headersSize": 402, - "httpVersion": "HTTP/1.1", - "method": "POST", - "postData": { - "mimeType": "application/json", - "params": [], - "text": "{\"trackers\":{\"0\":{\"tracking_code\":\"EZ1000000001\"},\"1\":{\"tracking_code\":\"EZ1000000002\"},\"2\":{\"tracking_code\":\"EZ1000000003\"},\"3\":{\"tracking_code\":\"EZ1000000004\"}}}" - }, - "queryString": [], - "url": "https://api.easypost.com/v2/trackers/create_list" - }, - "response": { - "bodySize": 44, - "content": { - "encoding": "base64", - "mimeType": "application/json; charset=utf-8", - "size": 44, - "text": "{}" - }, - "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": "6107a16c66a910efe2b87c5a003578fd" - }, - { - "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.075403" - }, - { - "name": "content-encoding", - "value": "gzip" - }, - { - "name": "transfer-encoding", - "value": "chunked" - }, - { - "name": "x-node", - "value": "bigweb32nuq" - }, - { - "name": "x-version-label", - "value": "easypost-202407300015-6e288fe720-master" - }, - { - "name": "x-backend", - "value": "easypost" - }, - { - "name": "x-canary", - "value": "direct" - }, - { - "name": "x-proxied", - "value": "intlb4nuq c0f5e722d1, extlb2nuq fa152d4755" - }, - { - "name": "strict-transport-security", - "value": "max-age=31536000; includeSubDomains; preload" - }, - { - "name": "connection", - "value": "close" - } - ], - "headersSize": 728, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2024-07-30T16:12:31.402Z", - "time": 173, - "timings": { - "blocked": -1, - "connect": -1, - "dns": -1, - "receive": 0, - "send": 0, - "ssl": -1, - "wait": 173 - } - } - ], - "pages": [], - "version": "1.2" - } -} diff --git a/test/services/tracker.test.js b/test/services/tracker.test.js index 8859216b2..204d1f7c2 100644 --- a/test/services/tracker.test.js +++ b/test/services/tracker.test.js @@ -69,17 +69,4 @@ describe('Tracker Service', function () { } } }); - - it('creates trackers in bulk from a list of tracking codes', async function () { - await this.client.Tracker.createList({ - 0: { tracking_code: 'EZ1000000001' }, - 1: { tracking_code: 'EZ1000000002' }, - 2: { tracking_code: 'EZ1000000003' }, - 3: { tracking_code: 'EZ1000000004' }, - }).then( - expect(function (result) { - result.not.to.throw(); - }), - ); - }); });