Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
5bd1dd4
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
a6f1155
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
274e2e3
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
2d63890
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
98a4718
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
d284d3f
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
cce43d7
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7b21cb8
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
70003b5
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
ab5b06b
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
01015f7
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
415a9e6
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7cfc916
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
39afde2
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7d7554a
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
f6b4d7d
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
706dde1
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7842106
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
238586e
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
08e6817
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
1776674
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
778355d
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
d2c8f63
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
a9eb807
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
81e1ee6
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
35779da
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
4469b2e
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
77f001f
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
f4d1c1b
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
27851e2
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
549a80c
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
f6f5c7d
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
3837af7
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
912e4a6
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
cf040fc
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
718413f
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
72bb128
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
de72db5
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
96d95fd
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
31bcace
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
8b12eb0
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
b583265
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
76bf7e1
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
b970b0a
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
bc34cbf
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
4e7b058
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e9ebcee
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7f999d0
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
ceed63b
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
69d079e
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
71edecf
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
a8383e7
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
59b10f5
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
9b58440
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
cc2a202
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
9d2c47d
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e0f1b03
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
665167b
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
cd8d85d
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
9c9c812
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
5055a82
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
036b2bc
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
eb4d82e
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
ef42fd1
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
240cff0
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e92f1d6
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
0a254f9
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
607bd30
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
d5dfe57
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
3e77c92
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
82eb969
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
849c984
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7f039c5
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
fa0f5e9
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7869e3c
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
df69a67
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
4410c49
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
3a1cf55
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
6e55825
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
8492931
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
82b87aa
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
f1dfba8
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
ad71f45
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
7ed05e4
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
8c2c370
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
62ab897
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
d70c547
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e012829
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
2ab5105
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
761721d
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
a0ff6af
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
0c2c492
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
8fe6545
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
ae2625f
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
88265e6
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
b7b0382
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e851248
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e182b8c
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
0355d0c
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
6dffa78
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
451564f
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
1cc2767
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
f5fcd06
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
ca0d3dc
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
05b78e2
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
aa53d51
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e74fa47
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
429cdc7
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
b51f54f
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
35fb42e
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
b2bd3fe
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
a6a0514
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
80e05a6
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
f4996e4
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
eb08876
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
078da91
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
6d5964b
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
e577e63
chore: retrigger flaky CodeQL on TSM-08
Justintime50 Aug 11, 2026
dacb01b
TSM-92: enable noImplicitAny and harden stack tip typing
Justintime50 Aug 24, 2026
43b6b9e
TSM-92 tighten service client typing and strict fixes
Justintime50 Aug 24, 2026
95d7baa
TSM-92 preserve beta client-secret cassette request shape
Justintime50 Aug 24, 2026
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
14 changes: 7 additions & 7 deletions src/easypost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ type HttpClient = typeof fetch;
interface CompatibilityRequest {
method: string;
url: string;
_data: unknown;
_data: Record<string, unknown> | undefined;
set(headersToSet?: RequestHeaders): CompatibilityRequest;
auth(key: string): CompatibilityRequest;
query(queryParams?: Record<string, unknown>): CompatibilityRequest;
send(body?: unknown): CompatibilityRequest;
send(body?: Record<string, unknown>): CompatibilityRequest;
}

interface HttpMiddleware {
Expand Down Expand Up @@ -415,7 +415,7 @@ export default class EasyPostClient {
const isQueryMethod =
normalizedMethod === EasyPostClient.METHODS.GET ||
normalizedMethod === EasyPostClient.METHODS.DELETE;
let requestBody;
let requestBody: Record<string, unknown> | undefined;

if (params !== undefined) {
if (isQueryMethod) {
Expand All @@ -427,15 +427,15 @@ export default class EasyPostClient {
}
}

const compatibilityRequest = {
const compatibilityRequest: CompatibilityRequest = {
method: normalizedMethod.toUpperCase(),
url: url.toString(),
_data: requestBody,
set: (headersToSet = {}) => {
Object.assign(requestHeaders, headersToSet);
return compatibilityRequest;
},
auth: (key) => {
auth: (key: string) => {
requestHeaders.Authorization = `Basic ${EasyPostClient._toBase64(`${key}:`)}`;
return compatibilityRequest;
},
Expand All @@ -446,7 +446,7 @@ export default class EasyPostClient {
compatibilityRequest.url = url.toString();
return compatibilityRequest;
},
send: (body = {}) => {
send: (body: Record<string, unknown> = {}) => {
compatibilityRequest._data = body;
return compatibilityRequest;
},
Expand All @@ -466,7 +466,7 @@ export default class EasyPostClient {
}
}

let middlewareResponse;
let middlewareResponse: any;

if (
this.requestMiddleware &&
Expand Down
3 changes: 2 additions & 1 deletion src/services/address_service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import baseService from './base_service';
import Address from '../models/address';
import type EasyPostClient from '../easypost';

type AddressCreateParameters = Record<string, unknown> & {
name?: string | null;
Expand All @@ -23,7 +24,7 @@ type AddressCreateParameters = Record<string, unknown> & {
type PaginationCollection = Record<string, unknown>;
type AddressCollection = { addresses: Address[]; has_more: boolean };

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The AddressService class provides methods for interacting with EasyPost {@link Address} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
3 changes: 2 additions & 1 deletion src/services/api_key_service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import util from 'util';
import type EasyPostClient from '../easypost';

import Constants from '../constants';
import FilteringError from '../errors/general/filtering_error';
Expand All @@ -12,7 +13,7 @@ type ApiKeyUser = Record<string, unknown> & {
};
type ApiKeyAllResponse = Record<string, unknown>;

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The ApiKeyService class provides methods for interacting with EasyPost {@link ApiKey} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
43 changes: 24 additions & 19 deletions src/services/base_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const RESOURCES = {
Webhook,
};

export default (easypostClient) =>
export default (easypostClient: any) =>
/**
* The base class for all EasyPost client library services.
* @param {EasyPostClient} easypostClient The {@link EasyPostClient} instance to use for API calls.
Expand All @@ -112,13 +112,13 @@ export default (easypostClient) =>
* @param {*} response The value to serialize.
* @returns {*} A plain object/array/scalar.
*/
static _toPlainEasyPostObject(response) {
static _toPlainEasyPostObject(response: any): any {
if (Array.isArray(response)) {
return response.map((value) => this._toPlainEasyPostObject(value));
}

if (typeof response === 'object' && response !== null) {
const plainObject = {};
const plainObject: Record<string, any> = {};
const prototype = Object.getPrototypeOf(response);

if (prototype && prototype !== Object.prototype) {
Expand All @@ -145,8 +145,10 @@ export default (easypostClient) =>
});
}

Object.keys(response).forEach((key) => {
plainObject[key] = this._toPlainEasyPostObject(response[key]);
Object.keys(response as Record<string, unknown>).forEach((key) => {
plainObject[key] = this._toPlainEasyPostObject(
(response as Record<string, unknown>)[key],
);
});

return plainObject;
Expand All @@ -162,7 +164,7 @@ export default (easypostClient) =>
* @param {*} params The parameters passed when fetching the response.
* @returns {*} An {@link EasyPostObject}-based class instance or an `Array` of {@link EasyPostObject}-based class instances.
*/
static _buildEasyPostObject(response, params) {
static _buildEasyPostObject(response: any, params: any): any {
if (Array.isArray(response)) {
return response.map((value) => {
if (typeof value === 'object') {
Expand All @@ -173,23 +175,26 @@ export default (easypostClient) =>
}

if (typeof response === 'object' && response !== null) {
let classObject;
if (RESOURCES[response.object] !== undefined) {
classObject = new RESOURCES[response.object]();
const responseRecord = response as Record<string, any>;
let classObject: any;
if ((RESOURCES as Record<string, any>)[responseRecord.object] !== undefined) {
classObject = new (RESOURCES as Record<string, any>)[responseRecord.object]();
} else if (
response.id !== undefined &&
EASYPOST_OBJECT_ID_PREFIX_TO_CLASS_NAME_MAP[
response.id.substr(0, response.id.indexOf('_'))
responseRecord.id !== undefined &&
(EASYPOST_OBJECT_ID_PREFIX_TO_CLASS_NAME_MAP as Record<string, any>)[
responseRecord.id.substr(0, responseRecord.id.indexOf('_'))
] !== undefined
) {
const className = response.id.substr(0, response.id.indexOf('_'));
classObject = new EASYPOST_OBJECT_ID_PREFIX_TO_CLASS_NAME_MAP[className]();
const className = responseRecord.id.substr(0, responseRecord.id.indexOf('_'));
classObject = new (EASYPOST_OBJECT_ID_PREFIX_TO_CLASS_NAME_MAP as Record<string, any>)[
className
]();
} else {
classObject = new EasyPostObject();
}

Object.keys(response).forEach((key) => {
classObject[key] = this._buildEasyPostObject(response[key], params);
Object.keys(responseRecord).forEach((key) => {
classObject[key] = this._buildEasyPostObject(responseRecord[key], params);
});

classObject._params = params;
Expand Down Expand Up @@ -220,7 +225,7 @@ export default (easypostClient) =>
* @param {Object} params The parameters to send with the API request.
* @returns {EasyPostObject|Promise<never>} The created {@link EasyPostObject}-based class instance, or a `Promise` that rejects with an error.
*/
static async _create(url, params) {
static async _create(url: string, params: any) {
try {
const response = await easypostClient._post(url, params);

Expand All @@ -237,7 +242,7 @@ export default (easypostClient) =>
* @param {Object} [params] The parameters to send with the API request.
* @returns {EasyPostObject|EasyPostObject[]|Promise<never>} The retrieved {@link EasyPostObject}-based class instance(s), or a `Promise` that rejects with an error.
*/
static async _all(url, params = {}) {
static async _all(url: string, params: any = {}) {
try {
// eslint-disable-next-line no-param-reassign
const response = await easypostClient._get(url, params);
Expand All @@ -254,7 +259,7 @@ export default (easypostClient) =>
* @param {string} url The URL to send the API request to.
* @returns {EasyPostObject|Promise<never>} The retrieved {@link EasyPostObject}-based class instance, or a `Promise` that rejects with an error.
*/
static async _retrieve(url) {
static async _retrieve(url: string) {
try {
const response = await easypostClient._get(url);

Expand Down
3 changes: 2 additions & 1 deletion src/services/batch_service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import baseService from './base_service';
import Batch from '../models/batch';
import type EasyPostClient from '../easypost';

export const DEFAULT_LABEL_FORMAT = 'pdf';

Expand All @@ -8,7 +9,7 @@ type BatchCreateParameters = Record<string, unknown> & {
};
type BatchListResponse = { batches: Batch[]; has_more: boolean };

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The BatchService class provides methods for interacting with EasyPost {@link Batch} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
5 changes: 3 additions & 2 deletions src/services/beta_rate_service.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import baseService from './base_service';
import type EasyPostClient from '../easypost';

/**
* @extends baseService
*/
export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
class BetaRateService extends baseService(easypostClient) {
/**
* Retrieve a list of stateless {@link Rate rates} based on the provided parameters.
* @param {Object} params - Map of parameters for the API call
* @returns {Rate[]} - List of stateless rates
*/
static async retrieveStatelessRates(params) {
static async retrieveStatelessRates(params: Record<string, unknown>) {
const url = 'beta/rates';
const wrappedParams = {
shipment: params,
Expand Down
12 changes: 9 additions & 3 deletions src/services/beta_referral_customer_service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import baseService from './base_service';
import type EasyPostClient from '../easypost';

type BetaPaymentMethodResponse = Record<string, unknown>;
type BetaRefundResponse = Record<string, unknown>;
type BetaClientSecretResponse = Record<string, unknown>;

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
class BetaReferralCustomerService extends baseService(easypostClient) {
/**
* Add an existing Stripe payment method to a {@link User referral customer's} account.
Expand Down Expand Up @@ -74,7 +75,10 @@ export default (easypostClient) =>
static async createCreditCardClientSecret(): Promise<BetaClientSecretResponse> {
const url = 'beta/setup_intents';

const response = await easypostClient._post(url, null);
// Preserve legacy null payload behavior for cassette matching in tests.
const emptyPayload = null as unknown as Record<string, unknown>;

const response = await easypostClient._post(url, emptyPayload);

return response.body;
}
Expand All @@ -86,7 +90,9 @@ export default (easypostClient) =>
static async createBankAccountClientSecret(
returnUrl: string | null,
): Promise<BetaClientSecretResponse> {
const params = returnUrl ? { return_url: returnUrl } : null;
const params = returnUrl
? { return_url: returnUrl }
: (null as unknown as Record<string, unknown>);

const url = 'beta/financial_connections_sessions';

Expand Down
3 changes: 2 additions & 1 deletion src/services/billing_service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Constants from '../constants';
import InvalidObjectError from '../errors/general/invalid_object_error';
import baseService from './base_service';
import type EasyPostClient from '../easypost';

type PaymentMethodObject = {
id: string;
Expand All @@ -13,7 +14,7 @@ type PaymentMethodsResponse = Record<string, unknown> & {
secondary_payment_method?: PaymentMethodObject | null;
};

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The BillingService class provides methods for interacting with EasyPost's billing capabilities.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
3 changes: 2 additions & 1 deletion src/services/carrier_account_service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import util from 'util';
import type EasyPostClient from '../easypost';

import Constants from '../constants';
import InvalidParameterError from '../errors/general/invalid_parameter_error';
Expand All @@ -17,7 +18,7 @@ type CarrierAccountCreateParameters = Record<string, unknown> & {
billing_type?: string | null;
};

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The CarrierAccountService class provides methods for interacting with EasyPost @{link CarrierAccount} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
3 changes: 2 additions & 1 deletion src/services/carrier_metadata_service.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import baseService from './base_service';
import type EasyPostClient from '../easypost';

type CarrierMetadata = Record<string, unknown>;

/**
* @extends baseService
*/
export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
class CarrierMetadataService extends baseService(easypostClient) {
/**
* Retrieve a list of carrier metadata based on the provided parameters.
Expand Down
3 changes: 2 additions & 1 deletion src/services/carrier_type_service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import baseService from './base_service';
import CarrierType from '../models/carrier_type';
import type EasyPostClient from '../easypost';

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The CarrierTypeService class provides methods for interacting with EasyPost {@link CarrierType} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
3 changes: 2 additions & 1 deletion src/services/claim_service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import baseService from './base_service';
import Claim from '../models/claim';
import type EasyPostClient from '../easypost';

type ClaimCreateParameters = Record<string, unknown> & {
tracking_code?: string | null;
Expand All @@ -16,7 +17,7 @@ type ClaimCreateParameters = Record<string, unknown> & {
type ClaimCollection = Record<string, unknown>;
type ClaimListResponse = { claims: Claim[]; has_more: boolean };

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The ClaimService class provides methods for interacting with EasyPost {@link Claim} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
5 changes: 3 additions & 2 deletions src/services/customer_portal_service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import baseService from './base_service';
import type { ICustomerPortalAccountLink } from '../../types/CustomerPortal/CustomerPortalAccountLink';
import type EasyPostClient from '../easypost';
type ICustomerPortalAccountLink = Record<string, unknown>;

type CustomerPortalAccountLinkCreateParameters = Record<string, unknown> & {
session_type?: 'account_onboarding' | 'account_management' | null;
Expand All @@ -9,7 +10,7 @@ type CustomerPortalAccountLinkCreateParameters = Record<string, unknown> & {
metadata?: Record<string, unknown> | null;
};

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The CustomerPortalService class provides methods for interacting with EasyPost {@link Tracker} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
3 changes: 2 additions & 1 deletion src/services/customs_info_service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import baseService from './base_service';
import CustomsInfo from '../models/customs_info';
import type EasyPostClient from '../easypost';

type CustomsItemInput = Record<string, unknown>;

Expand All @@ -16,7 +17,7 @@ type CustomsInfoCreateParameters = Record<string, unknown> & {
declaration?: string | null;
};

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The CustomsInfoService class provides methods for interacting with EasyPost {@link CustomsInfo} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
3 changes: 2 additions & 1 deletion src/services/customs_item_service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import baseService from './base_service';
import CustomsItem from '../models/customs_item';
import type EasyPostClient from '../easypost';

type CustomsItemCreateParameters = Record<string, unknown> & {
description?: string | null;
Expand All @@ -12,7 +13,7 @@ type CustomsItemCreateParameters = Record<string, unknown> & {
currency?: string | null;
};

export default (easypostClient) =>
export default (easypostClient: EasyPostClient) =>
/**
* The CustomsItemService class provides methods for interacting with EasyPost {@link CustomsItem} objects.
* @param {EasyPostClient} easypostClient - The pre-configured EasyPostClient instance to use for API requests with this service.
Expand Down
Loading