Skip to content

Commit 59bbaff

Browse files
authored
Remove retired estimates endpoints (#99)
* Remove retired estimates endpoints * Remove /eth * Update specs
1 parent 3e4286c commit 59bbaff

9 files changed

+145
-564
lines changed

Diff for: package-lock.json

+32-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@patch-technology/patch",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"description": "Node.js wrapper for the Patch API",
55
"license": "MIT",
66
"repository": {
@@ -48,7 +48,7 @@
4848
"husky": "^4.2.5",
4949
"lint-staged": "^10.5.4",
5050
"mocha": "^10.4.0",
51-
"sinon": "^18.0.0",
51+
"sinon": "^17.0.1",
5252
"prettier": "^3.2.5"
5353
},
5454
"files": [

Diff for: src/ApiClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ApiClient {
1616
};
1717

1818
this.defaultHeaders = {
19-
'User-Agent': 'patch-node/2.2.0',
19+
'User-Agent': 'patch-node/2.3.0',
2020
'Patch-Version': 2
2121
};
2222

Diff for: src/api/EstimatesApi.js

-165
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ import ApiClient from '../ApiClient';
99
import CreateAirShippingEstimateRequest from '../model/CreateAirShippingEstimateRequest';
1010
import CreateBitcoinEstimateRequest from '../model/CreateBitcoinEstimateRequest';
1111
import CreateEcommerceEstimateRequest from '../model/CreateEcommerceEstimateRequest';
12-
import CreateEthereumEstimateRequest from '../model/CreateEthereumEstimateRequest';
1312
import CreateFlightEstimateRequest from '../model/CreateFlightEstimateRequest';
1413
import CreateHotelEstimateRequest from '../model/CreateHotelEstimateRequest';
1514
import CreateMassEstimateRequest from '../model/CreateMassEstimateRequest';
1615
import CreateRailShippingEstimateRequest from '../model/CreateRailShippingEstimateRequest';
1716
import CreateRoadShippingEstimateRequest from '../model/CreateRoadShippingEstimateRequest';
1817
import CreateSeaShippingEstimateRequest from '../model/CreateSeaShippingEstimateRequest';
19-
import CreateShippingEstimateRequest from '../model/CreateShippingEstimateRequest';
20-
import CreateVehicleEstimateRequest from '../model/CreateVehicleEstimateRequest';
2118
import ErrorResponse from '../model/ErrorResponse';
2219
import EstimateListResponse from '../model/EstimateListResponse';
2320
import EstimateResponse from '../model/EstimateResponse';
@@ -192,60 +189,6 @@ export default class EstimatesApi {
192189
);
193190
}
194191

195-
createEthereumEstimateWithHttpInfo(createEthereumEstimateRequest, opts) {
196-
opts = opts || {};
197-
198-
const _createEthereumEstimateRequest =
199-
CreateEthereumEstimateRequest.constructFromObject(
200-
createEthereumEstimateRequest,
201-
new CreateEthereumEstimateRequest()
202-
);
203-
204-
// verify the required parameter 'createEthereumEstimateRequest' is set
205-
if (
206-
_createEthereumEstimateRequest === undefined ||
207-
_createEthereumEstimateRequest === null
208-
) {
209-
throw new Error(
210-
"Missing the required parameter 'createEthereumEstimateRequest' when calling createEthereumEstimate"
211-
);
212-
}
213-
214-
let postBody = _createEthereumEstimateRequest;
215-
let pathParams = {};
216-
let queryParams = {};
217-
let headerParams = {
218-
'Patch-Version': opts['patchVersion']
219-
};
220-
let formParams = {};
221-
222-
let authNames = ['bearer_auth'];
223-
let contentTypes = ['application/json'];
224-
let accepts = ['application/json'];
225-
let returnType = EstimateResponse;
226-
227-
return this.apiClient.callApi(
228-
'/v1/estimates/crypto/eth',
229-
'POST',
230-
pathParams,
231-
queryParams,
232-
headerParams,
233-
formParams,
234-
postBody,
235-
authNames,
236-
contentTypes,
237-
accepts,
238-
returnType
239-
);
240-
}
241-
242-
createEthereumEstimate(createEthereumEstimateRequest, opts) {
243-
return this.createEthereumEstimateWithHttpInfo(
244-
createEthereumEstimateRequest,
245-
opts
246-
);
247-
}
248-
249192
createFlightEstimateWithHttpInfo(createFlightEstimateRequest, opts) {
250193
opts = opts || {};
251194

@@ -576,114 +519,6 @@ export default class EstimatesApi {
576519
);
577520
}
578521

579-
createShippingEstimateWithHttpInfo(createShippingEstimateRequest, opts) {
580-
opts = opts || {};
581-
582-
const _createShippingEstimateRequest =
583-
CreateShippingEstimateRequest.constructFromObject(
584-
createShippingEstimateRequest,
585-
new CreateShippingEstimateRequest()
586-
);
587-
588-
// verify the required parameter 'createShippingEstimateRequest' is set
589-
if (
590-
_createShippingEstimateRequest === undefined ||
591-
_createShippingEstimateRequest === null
592-
) {
593-
throw new Error(
594-
"Missing the required parameter 'createShippingEstimateRequest' when calling createShippingEstimate"
595-
);
596-
}
597-
598-
let postBody = _createShippingEstimateRequest;
599-
let pathParams = {};
600-
let queryParams = {};
601-
let headerParams = {
602-
'Patch-Version': opts['patchVersion']
603-
};
604-
let formParams = {};
605-
606-
let authNames = ['bearer_auth'];
607-
let contentTypes = ['application/json'];
608-
let accepts = ['application/json'];
609-
let returnType = EstimateResponse;
610-
611-
return this.apiClient.callApi(
612-
'/v1/estimates/shipping',
613-
'POST',
614-
pathParams,
615-
queryParams,
616-
headerParams,
617-
formParams,
618-
postBody,
619-
authNames,
620-
contentTypes,
621-
accepts,
622-
returnType
623-
);
624-
}
625-
626-
createShippingEstimate(createShippingEstimateRequest, opts) {
627-
return this.createShippingEstimateWithHttpInfo(
628-
createShippingEstimateRequest,
629-
opts
630-
);
631-
}
632-
633-
createVehicleEstimateWithHttpInfo(createVehicleEstimateRequest, opts) {
634-
opts = opts || {};
635-
636-
const _createVehicleEstimateRequest =
637-
CreateVehicleEstimateRequest.constructFromObject(
638-
createVehicleEstimateRequest,
639-
new CreateVehicleEstimateRequest()
640-
);
641-
642-
// verify the required parameter 'createVehicleEstimateRequest' is set
643-
if (
644-
_createVehicleEstimateRequest === undefined ||
645-
_createVehicleEstimateRequest === null
646-
) {
647-
throw new Error(
648-
"Missing the required parameter 'createVehicleEstimateRequest' when calling createVehicleEstimate"
649-
);
650-
}
651-
652-
let postBody = _createVehicleEstimateRequest;
653-
let pathParams = {};
654-
let queryParams = {};
655-
let headerParams = {
656-
'Patch-Version': opts['patchVersion']
657-
};
658-
let formParams = {};
659-
660-
let authNames = ['bearer_auth'];
661-
let contentTypes = ['application/json'];
662-
let accepts = ['application/json'];
663-
let returnType = EstimateResponse;
664-
665-
return this.apiClient.callApi(
666-
'/v1/estimates/vehicle',
667-
'POST',
668-
pathParams,
669-
queryParams,
670-
headerParams,
671-
formParams,
672-
postBody,
673-
authNames,
674-
contentTypes,
675-
accepts,
676-
returnType
677-
);
678-
}
679-
680-
createVehicleEstimate(createVehicleEstimateRequest, opts) {
681-
return this.createVehicleEstimateWithHttpInfo(
682-
createVehicleEstimateRequest,
683-
opts
684-
);
685-
}
686-
687522
retrieveEstimateWithHttpInfo(id, opts) {
688523
opts = opts || {};
689524

0 commit comments

Comments
 (0)