From f32cb50a954071f785f696a5a66791408f6e0186 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Thu, 6 Aug 2026 15:16:45 -0600 Subject: [PATCH 1/3] step5: convert base service hydration layer to ts --- src/models/{easypost_object.js => easypost_object.ts} | 1 + src/services/{base_service.js => base_service.ts} | 1 + 2 files changed, 2 insertions(+) rename src/models/{easypost_object.js => easypost_object.ts} (98%) rename src/services/{base_service.js => base_service.ts} (99%) diff --git a/src/models/easypost_object.js b/src/models/easypost_object.ts similarity index 98% rename from src/models/easypost_object.js rename to src/models/easypost_object.ts index deb10eb4..ae83c83b 100644 --- a/src/models/easypost_object.js +++ b/src/models/easypost_object.ts @@ -1,3 +1,4 @@ +// @ts-nocheck /** * An EasyPostObject is the base class for all EasyPost API resources. * @internal diff --git a/src/services/base_service.js b/src/services/base_service.ts similarity index 99% rename from src/services/base_service.js rename to src/services/base_service.ts index 66aced01..6d11053a 100644 --- a/src/services/base_service.js +++ b/src/services/base_service.ts @@ -1,3 +1,4 @@ +// @ts-nocheck import EndOfPaginationError from '../errors/general/end_of_pagination_error'; import Address from '../models/address'; import ApiKey from '../models/api_key'; From dbd18786ae6520d55237435db5705c68589435f5 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 7 Aug 2026 13:25:46 -0600 Subject: [PATCH 2/3] tsm-05: remove ts-nocheck from base hydration layers --- src/models/easypost_object.ts | 24 ++++++++++++++---------- src/services/base_service.ts | 1 - 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/models/easypost_object.ts b/src/models/easypost_object.ts index ae83c83b..46b25e60 100644 --- a/src/models/easypost_object.ts +++ b/src/models/easypost_object.ts @@ -1,28 +1,32 @@ -// @ts-nocheck /** * An EasyPostObject is the base class for all EasyPost API resources. * @internal * @abstract */ export default class EasyPostObject { - static id; - static object; - static mode; - static created_at; - static updated_at; - static _params; + static id: string; + static object: string; + static mode: string; + static created_at: string; + static updated_at: string; + static _params: Record; - static [Symbol.hasInstance](instance) { + static [Symbol.hasInstance](instance: unknown): boolean { if (instance == null || typeof instance !== 'object') { return false; } - const modelConstructor = instance[Symbol.for('easypost.modelConstructor')]; + const modelConstructor = (instance as Record)[ + Symbol.for('easypost.modelConstructor') + ]; if (typeof modelConstructor === 'function') { return modelConstructor === this; } // Fallback for plain API payloads that include object names like "Address" or "Shipment". - return typeof instance.object === 'string' && instance.object === this.name; + return ( + typeof (instance as Record).object === 'string' && + (instance as Record).object === this.name + ); } } diff --git a/src/services/base_service.ts b/src/services/base_service.ts index 6d11053a..558efff3 100644 --- a/src/services/base_service.ts +++ b/src/services/base_service.ts @@ -6,7 +6,6 @@ import Batch from '../models/batch'; import Brand from '../models/brand'; import CarrierAccount from '../models/carrier_account'; import CarrierType from '../models/carrier_type'; -import Claim from '../models/claim'; import CustomsInfo from '../models/customs_info'; import CustomsItem from '../models/customs_item'; import EasyPostObject from '../models/easypost_object'; From 7833d536a6a7609eda474027c97d7eb4b941de91 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 7 Aug 2026 13:26:34 -0600 Subject: [PATCH 3/3] tsm-05: remove ts-nocheck and stabilize base typing --- src/services/base_service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/base_service.ts b/src/services/base_service.ts index 558efff3..10cd2d82 100644 --- a/src/services/base_service.ts +++ b/src/services/base_service.ts @@ -1,4 +1,3 @@ -// @ts-nocheck import EndOfPaginationError from '../errors/general/end_of_pagination_error'; import Address from '../models/address'; import ApiKey from '../models/api_key'; @@ -6,6 +5,7 @@ import Batch from '../models/batch'; import Brand from '../models/brand'; import CarrierAccount from '../models/carrier_account'; import CarrierType from '../models/carrier_type'; +import Claim from '../models/claim'; import CustomsInfo from '../models/customs_info'; import CustomsItem from '../models/customs_item'; import EasyPostObject from '../models/easypost_object'; @@ -207,7 +207,7 @@ export default (easypostClient) => * @param {*} params The parameters passed when fetching the response. * @returns {*} A plain object or array suitable for JSON serialization. */ - static _convertToEasyPostObject(response, params) { + static _convertToEasyPostObject(response, params = {}) { const modelResponse = this._buildEasyPostObject(response, params); return this._toPlainEasyPostObject(modelResponse);