Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## Next Release

- Adds the following functions:
- `embeddable.createSession`
- `customerPortal.createAccountLink`
- Bumps dependencies

## v8.3.0 (2025-11-10)

- Adds support for `UspsShipAccount`
Expand Down
1,922 changes: 850 additions & 1,072 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@pollyjs/persister-fs": "^6.0.6",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitest/coverage-istanbul": "^3.0.6",
"@vitest/coverage-istanbul": "^4.0.10",
"audit-ci": "^7.1",
"chai": "5.2",
"chai-as-promised": "^8.0.1",
Expand All @@ -74,7 +74,7 @@
"typescript": "^4.9.5 || ~5.0.0",
"vite": "^6.2",
"vite-plugin-externals": "^0.6.2",
"vitest": "^3.0.6",
"vitest": "^4.0.10",
"vows": "^0.8.3"
}
}
4 changes: 4 additions & 0 deletions src/easypost.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import CarrierAccountService from './services/carrier_account_service';
import CarrierMetadataService from './services/carrier_metadata_service';
import CarrierTypeService from './services/carrier_type_service';
import ClaimService from './services/claim_service';
import CustomerPortalService from './services/customer_portal_service';
import CustomsInfoService from './services/customs_info_service';
import CustomsItemService from './services/customs_item_service';
import EmbeddableService from './services/embeddable_service';
import EndShipperService from './services/end_shipper_service';
import EventService from './services/event_service';
import InsuranceService from './services/insurance_service';
Expand Down Expand Up @@ -367,8 +369,10 @@ EasyPostClient.SERVICES = {
CarrierMetadata: CarrierMetadataService,
CarrierType: CarrierTypeService,
Claim: ClaimService,
CustomerPortal: CustomerPortalService,
CustomsInfo: CustomsInfoService,
CustomsItem: CustomsItemService,
Embeddable: EmbeddableService,
EndShipper: EndShipperService,
Event: EventService,
Insurance: InsuranceService,
Expand Down
25 changes: 25 additions & 0 deletions src/services/customer_portal_service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import baseService from './base_service';

export default (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.
*/
class CustomerPortalService extends baseService(easypostClient) {
/**
* Create a Portal Session.
* @param {Object} [params] - The parameters to create a session from.
* @returns {Object} - An object containing the created session.
*/
static async createAccountLink(params = {}) {
const url = 'customer_portal/account_link';

try {
const response = await easypostClient._post(url, params);

return this._convertToEasyPostObject(response.body, params);
} catch (e) {
return Promise.reject(e);
}
}
};
25 changes: 25 additions & 0 deletions src/services/embeddable_service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import baseService from './base_service';

export default (easypostClient) =>
/**
* The EmbeddableService 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.
*/
class EmbeddableService extends baseService(easypostClient) {
/**
* Create an Embeddable Session.
* @param {Object} [params] - The parameters to create a session from.
* @returns {Object} - An object containing the created session.
*/
static async createSession(params = {}) {
const url = 'embeddables/session';

try {
const response = await easypostClient._post(url, params);

return this._convertToEasyPostObject(response.body, params);
} catch (e) {
return Promise.reject(e);
}
}
};
Loading
Loading