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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.5.0] - 2025-08-19

### Removed

- Removes `createFlightEstimate` method

## [2.4.0] - 2025-05-16

### Removed
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ Estimates allow API users to get a quote for the cost of compensating a certain
const mass_g = 1000000; // Pass in the mass in grams (i.e. 1 metric tonne)
patch.estimates.createMassEstimate({ mass_g });

// Create a flight estimate
const distance_m = 9000000; // Pass in the distance traveled in meters
patch.estimates.createFlightEstimate({ distance_m });

// Create an ecommerce estimate
const distance_m = 9000000;
// Pass in the shipping distance in meters, the transportation method, and the package mass
Expand Down
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@patch-technology/patch",
"version": "2.4.0",
"version": "2.5.0",
"description": "Node.js wrapper for the Patch API",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiClient {
};

this.defaultHeaders = {
'User-Agent': 'patch-node/2.4.0',
'User-Agent': 'patch-node/2.5.0',
'Patch-Version': 2
};

Expand Down
55 changes: 0 additions & 55 deletions src/api/EstimatesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import ApiClient from '../ApiClient';
import CreateAirShippingEstimateRequest from '../model/CreateAirShippingEstimateRequest';
import CreateBitcoinEstimateRequest from '../model/CreateBitcoinEstimateRequest';
import CreateFlightEstimateRequest from '../model/CreateFlightEstimateRequest';
import CreateMassEstimateRequest from '../model/CreateMassEstimateRequest';
import CreateRailShippingEstimateRequest from '../model/CreateRailShippingEstimateRequest';
import CreateRoadShippingEstimateRequest from '../model/CreateRoadShippingEstimateRequest';
Expand Down Expand Up @@ -133,60 +132,6 @@ export default class EstimatesApi {
);
}

createFlightEstimateWithHttpInfo(createFlightEstimateRequest, opts) {
opts = opts || {};

const _createFlightEstimateRequest =
CreateFlightEstimateRequest.constructFromObject(
createFlightEstimateRequest,
new CreateFlightEstimateRequest()
);

// verify the required parameter 'createFlightEstimateRequest' is set
if (
_createFlightEstimateRequest === undefined ||
_createFlightEstimateRequest === null
) {
throw new Error(
"Missing the required parameter 'createFlightEstimateRequest' when calling createFlightEstimate"
);
}

let postBody = _createFlightEstimateRequest;
let pathParams = {};
let queryParams = {};
let headerParams = {
'Patch-Version': opts['patchVersion']
};
let formParams = {};

let authNames = ['bearer_auth'];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = EstimateResponse;

return this.apiClient.callApi(
'/v1/estimates/flight',
'POST',
pathParams,
queryParams,
headerParams,
formParams,
postBody,
authNames,
contentTypes,
accepts,
returnType
);
}

createFlightEstimate(createFlightEstimateRequest, opts) {
return this.createFlightEstimateWithHttpInfo(
createFlightEstimateRequest,
opts
);
}

createMassEstimateWithHttpInfo(createMassEstimateRequest, opts) {
opts = opts || {};

Expand Down
79 changes: 0 additions & 79 deletions src/model/CreateEcommerceEstimateRequest.js

This file was deleted.

97 changes: 0 additions & 97 deletions src/model/CreateFlightEstimateRequest.js

This file was deleted.

13 changes: 0 additions & 13 deletions test/integration/estimates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ describe('Estimates Integration', function () {
expect(retrieveEstimatesResponse.data.length).to.be.above(0);
});

it('supports creating flight estimates with airports', async function () {
const { data: estimate1 } = await patch.estimates.createFlightEstimate({
origin_airport: 'SFO',
destination_airport: 'LAX'
});
const { data: estimate2 } = await patch.estimates.createFlightEstimate({
origin_airport: 'SFO',
destination_airport: 'JFK'
});

expect(estimate2.mass_g).to.be.greaterThan(estimate1.mass_g);
});

it('supports creating bitcoin estimates without parameters', async function () {
const { data: estimate } = await patch.estimates.createBitcoinEstimate();

Expand Down
Loading