Skip to content

TSM-07: convert Group B services to TypeScript - #564

Open
Justin Hammond (Justintime50) wants to merge 6 commits into
ts-migrate/06-services-group-afrom
ts-migrate/07-services-group-b
Open

TSM-07: convert Group B services to TypeScript#564
Justin Hammond (Justintime50) wants to merge 6 commits into
ts-migrate/06-services-group-afrom
ts-migrate/07-services-group-b

Conversation

@Justintime50

@Justintime50 Justin Hammond (Justintime50) commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Convert Group B services to TypeScript: Batch, Order, Pickup, Rate, SmartRate, ScanForm, and Refund.
  • Keep runtime behavior unchanged while moving service modules to .ts.

Validation

  • npm run typescript
  • npm run build
  • Targeted Group B service tests

@Justintime50
Justin Hammond (Justintime50) force-pushed the ts-migrate/07-services-group-b branch 9 times, most recently from 175748d to 1e69a00 Compare August 12, 2026 17:22
@Justintime50
Justin Hammond (Justintime50) marked this pull request as ready for review August 12, 2026 20:27

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Non blocking, but just want clairification on the intention of these PRs. Are we explicitly wanting all the input types to be much more loosey-goosey than before, or are we trying to like recreate/reuse the well defined and structured types from before?

Comment on lines +6 to +8
type BatchCreateParameters = Record<string, unknown> & {
shipments?: Array<string | Record<string, unknown>> | null;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought:
These new types are still not as thorough as the old ones. For example, for the create batch params, here are the existing types in https://github.com/EasyPost/easypost-node/blob/master/types/Batch/BatchCreateParameters.d.ts:

export declare interface IBatchCreateParameters {
  shipments?: Array<Shipment | string>;
}

Where shipment is a fully fleshed type listing the fields and their types.

I'm wondering if the plan is to eventually go through and use these existing types or if they should be reimplemented here? We are already importing the batch type. I wonder if we should import the create param here as well?

Comment on lines +4 to +5
type PickupCreateParameters = Record<string, unknown> & {
address?: Record<string, unknown> | string | null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought:
Same thing here. This Record<string, unknown> is explicitly wider than what we had. Not sure if thats intentional. But then the sub-record fields are loosey goosey "just pass whatever", where the original types had

interface BasePickupCreateParameters {
  address: Address | string;
  // ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants