From 48f79318068ad958d38489c48b99b611eec6470b Mon Sep 17 00:00:00 2001 From: Daniel K Date: Tue, 12 Dec 2023 14:59:05 -0800 Subject: [PATCH 1/5] (fix) issues with dynamically set paperless_trade option and dhl_express_all fallback --- .../karrio/providers/dhl_express/rate.py | 10 ++-------- .../karrio/providers/dhl_express/shipment.py | 8 +------- .../karrio/providers/dhl_express/units.py | 14 ++------------ .../dhl_express/tests/dhl_express/test_rate.py | 3 --- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/modules/connectors/dhl_express/karrio/providers/dhl_express/rate.py b/modules/connectors/dhl_express/karrio/providers/dhl_express/rate.py index be576ac862..3bec9eb0ac 100644 --- a/modules/connectors/dhl_express/karrio/providers/dhl_express/rate.py +++ b/modules/connectors/dhl_express/karrio/providers/dhl_express/rate.py @@ -104,11 +104,7 @@ def rate_request( is_document = all([parcel.is_document for parcel in payload.parcels]) is_from_EU = payload.shipper.country_code in units.EUCountry is_to_EU = payload.recipient.country_code in units.EUCountry - is_dutiable = ( - is_international - and not is_document - and not (is_from_EU and is_to_EU) - ) + is_dutiable = is_international and not is_document and not (is_from_EU and is_to_EU) services = lib.to_services( payload.services, @@ -120,9 +116,7 @@ def rate_request( ) options = lib.to_shipping_options( payload.options, - is_dutiable=is_dutiable, package_options=packages.options, - shipper_country=payload.shipper.country_code, initializer=provider_units.shipping_options_initializer, ) @@ -205,7 +199,7 @@ def rate_request( ) for svc in services ] - if any(options.items()) + if any([_.value for _ in services]) else None ), ), diff --git a/modules/connectors/dhl_express/karrio/providers/dhl_express/shipment.py b/modules/connectors/dhl_express/karrio/providers/dhl_express/shipment.py index 88c74425fb..3c9913b50e 100644 --- a/modules/connectors/dhl_express/karrio/providers/dhl_express/shipment.py +++ b/modules/connectors/dhl_express/karrio/providers/dhl_express/shipment.py @@ -102,16 +102,10 @@ def shipment_request( is_international = shipper.country_code != recipient.country_code is_from_EU = payload.shipper.country_code in units.EUCountry is_to_EU = payload.recipient.country_code in units.EUCountry - is_dutiable = ( - is_international - and not is_document - and not (is_from_EU and is_to_EU) - ) + is_dutiable = is_international and not is_document and not (is_from_EU and is_to_EU) options = lib.to_shipping_options( payload.options, - is_dutiable=is_dutiable, package_options=packages.options, - shipper_country=payload.shipper.country_code, initializer=provider_units.shipping_options_initializer, ) diff --git a/modules/connectors/dhl_express/karrio/providers/dhl_express/units.py b/modules/connectors/dhl_express/karrio/providers/dhl_express/units.py index 973b83226d..9afdc11e4d 100644 --- a/modules/connectors/dhl_express/karrio/providers/dhl_express/units.py +++ b/modules/connectors/dhl_express/karrio/providers/dhl_express/units.py @@ -289,7 +289,7 @@ class ConnectionConfig(lib.Enum): shipping_services = lib.OptionEnum("shipping_services", list) -class ShippingService(lib.StrEnum): +class ShippingService(lib.Enum): dhl_logistics_services = "0" dhl_domestic_express_12_00 = "1" dhl_express_choice = "2" @@ -326,7 +326,7 @@ class ShippingService(lib.StrEnum): dhl_express_envelope = "X" dhl_express_12_00_nondoc = "Y" dhl_destination_charges = "Z" - dhl_express_all = "" + dhl_express_all = None def shipping_services_initializer( @@ -597,23 +597,13 @@ class ShippingOption(lib.Enum): def shipping_options_initializer( options: dict, - is_dutiable: bool = False, package_options: lib.units.Options = None, - shipper_country: str = "", ) -> lib.units.Options: """ Apply default values to the given options. """ _options = options.copy() - if ( - is_dutiable - and ShippingOption.paperless_trade.name not in options - and ShippingOption.dhl_paperless_trade.name not in options - and shipper_country not in UNSUPPORTED_PAPERLESS_COUNTRIES - ): - _options.update({ShippingOption.dhl_paperless_trade.name: True}) - if package_options is not None: _options.update(package_options.content) diff --git a/modules/connectors/dhl_express/tests/dhl_express/test_rate.py b/modules/connectors/dhl_express/tests/dhl_express/test_rate.py index ac0624c93c..fa3f53a74d 100644 --- a/modules/connectors/dhl_express/tests/dhl_express/test_rate.py +++ b/modules/connectors/dhl_express/tests/dhl_express/test_rate.py @@ -444,9 +444,6 @@ def test_parse_rate_vol_weight_higher_response(self): P P - - WY - From 93f72f6191d9bb6b3f57e7c132e376a300ef5b95 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Tue, 12 Dec 2023 15:29:19 -0800 Subject: [PATCH 2/5] (add) support for shipment message parsing for easypost and clean up imports --- .../easypost/karrio/mappers/easypost/proxy.py | 55 ++++++++++--------- .../karrio/providers/easypost/error.py | 44 +++++++++------ .../karrio/providers/easypost/rate.py | 6 +- .../providers/easypost/shipment/cancel.py | 25 +++++---- .../providers/easypost/shipment/create.py | 10 +--- .../karrio/providers/easypost/tracking.py | 13 +++-- .../karrio/providers/easypost/units.py | 4 +- .../easypost/schemas/shipments_response.json | 2 +- .../easypost/tests/easypost/test_rate.py | 6 +- .../easypost/tests/easypost/test_shipment.py | 8 +-- .../easypost/tests/easypost/test_tracking.py | 6 +- 11 files changed, 95 insertions(+), 84 deletions(-) diff --git a/modules/connectors/easypost/karrio/mappers/easypost/proxy.py b/modules/connectors/easypost/karrio/mappers/easypost/proxy.py index a5e855756b..4d82c1410a 100644 --- a/modules/connectors/easypost/karrio/mappers/easypost/proxy.py +++ b/modules/connectors/easypost/karrio/mappers/easypost/proxy.py @@ -1,28 +1,27 @@ -from typing import List, Tuple -from karrio.core.utils import DP, request as http -from karrio.api.proxy import Proxy as BaseProxy -from karrio.core.utils.helpers import exec_async -from karrio.mappers.easypost.settings import Settings -from karrio.core.utils.serializable import Serializable, Deserializable +import typing +import karrio.lib as lib +import karrio.api.proxy as base +import karrio.mappers.easypost.settings as provider_settings -class Proxy(BaseProxy): - settings: Settings +class Proxy(base.Proxy): + settings: provider_settings.Settings - def get_rates(self, request: Serializable) -> Deserializable: + def get_rates(self, request: lib.Serializable) -> lib.Deserializable: response = self._send_request( - path="/shipments", request=Serializable(request.serialize(), DP.jsonify) + path="/shipments", + request=lib.Serializable(request.serialize(), lib.to_json), ) - return Deserializable(response, DP.to_dict) + return lib.Deserializable(response, lib.to_dict) - def create_shipment(self, request: Serializable) -> Deserializable: + def create_shipment(self, request: lib.Serializable) -> lib.Deserializable: payload = request.serialize() def create(request) -> str: - response = DP.to_dict( + response = lib.to_dict( self._send_request( - path="/shipments", request=Serializable(request, DP.jsonify) + path="/shipments", request=lib.Serializable(request, lib.to_json) ) ) @@ -38,7 +37,7 @@ def create(request) -> str: ), None, ) - data = DP.to_dict( + data = lib.to_dict( { "rate": {"id": rate_id}, "insurance": payload.get("insurance"), @@ -50,40 +49,44 @@ def create(request) -> str: return self._send_request( path=f"/shipments/{response['id']}/buy", - request=Serializable(data, DP.jsonify), + request=lib.Serializable(data, lib.to_json), ) response = create(payload["data"]) - return Deserializable(response, DP.to_dict) + return lib.Deserializable(response, lib.to_dict) - def cancel_shipment(self, request: Serializable) -> Deserializable: + def cancel_shipment(self, request: lib.Serializable) -> lib.Deserializable: response = self._send_request(path=f"/shipments/{request.serialize()}/refund") - return Deserializable(response, DP.to_dict) + return lib.Deserializable(response, lib.to_dict) - def get_tracking(self, requests: Serializable) -> Deserializable: + def get_tracking(self, requests: lib.Serializable) -> lib.Deserializable: track = lambda request: ( request["tracking_code"], self._send_request( **( - dict(path="/trackers", request=Serializable(request, DP.jsonify)) + dict( + path="/trackers", request=lib.Serializable(request, lib.to_json) + ) if request.get("tracker_id") is None else dict(path=f"/trackers/{request['tracker_id']}", method="GET") ) ), ) - responses: List[Tuple[str, str]] = exec_async(track, requests.serialize()) - return Deserializable( + responses: typing.List[typing.Tuple[str, str]] = lib.run_asynchronously( + track, requests.serialize() + ) + return lib.Deserializable( responses, - lambda res: [(key, DP.to_dict(response)) for key, response in res], + lambda res: [(key, lib.to_dict(response)) for key, response in res], ) def _send_request( - self, path: str, request: Serializable = None, method: str = "POST" + self, path: str, request: lib.Serializable = None, method: str = "POST" ) -> str: data: dict = dict(data=request.serialize()) if request is not None else dict() - return http( + return lib.request( **{ "url": f"{self.settings.server_url}{path}", "trace": self.trace_as("json"), diff --git a/modules/connectors/easypost/karrio/providers/easypost/error.py b/modules/connectors/easypost/karrio/providers/easypost/error.py index f4173250ae..4070ada9e3 100644 --- a/modules/connectors/easypost/karrio/providers/easypost/error.py +++ b/modules/connectors/easypost/karrio/providers/easypost/error.py @@ -1,21 +1,31 @@ -from karrio.schemas.easypost.error_response import Error -from karrio.core.utils import DP -from karrio.core.models import Message -from karrio.providers.easypost.utils import Settings +import typing +import karrio.lib as lib +import karrio.core.models as models +import karrio.providers.easypost.utils as provider_utils def parse_error_response( - response: dict, settings: Settings, details: dict = None -) -> Message: - error = DP.to_object(Error, response.get("error")) + response: dict, settings: provider_utils.Settings, **kwargs +) -> typing.List[models.Message]: + errors = [ + *response.get("messages", []), + *([response.get("error")] if "error" in response else []), + ] - return Message( - carrier_id=settings.carrier_id, - carrier_name=settings.carrier_name, - code=error.code, - message=error.message, - details={ - "errors": error.errors or [], - **(details or {}), - }, - ) + return [ + models.Message( + carrier_id=settings.carrier_id, + carrier_name=settings.carrier_name, + code=(error.get("code") or error.get("type")), + message=error.get("message"), + details=lib.to_dict( + { + "errors": error.get("errors"), + "carrier": error.get("carrier"), + "carrier_account_id": error.get("carrier_account_id"), + **kwargs, + } + ), + ) + for error in errors + ] diff --git a/modules/connectors/easypost/karrio/providers/easypost/rate.py b/modules/connectors/easypost/karrio/providers/easypost/rate.py index fd91eaad5b..ee37acfc76 100644 --- a/modules/connectors/easypost/karrio/providers/easypost/rate.py +++ b/modules/connectors/easypost/karrio/providers/easypost/rate.py @@ -15,11 +15,7 @@ def parse_rate_response( settings: provider_utils.Settings, ) -> typing.Tuple[models.RateDetails, typing.List[models.Message]]: response = _response.deserialize() - errors = ( - [provider_error.parse_error_response(response, settings)] - if "error" in response - else [] - ) + errors = provider_error.parse_error_response(response, settings) rates = _extract_details(response, settings) if "error" not in response else [] return rates, errors diff --git a/modules/connectors/easypost/karrio/providers/easypost/shipment/cancel.py b/modules/connectors/easypost/karrio/providers/easypost/shipment/cancel.py index 514f522d35..fe5c7b565e 100644 --- a/modules/connectors/easypost/karrio/providers/easypost/shipment/cancel.py +++ b/modules/connectors/easypost/karrio/providers/easypost/shipment/cancel.py @@ -1,20 +1,21 @@ -from typing import List, Tuple -from karrio.core.models import ShipmentCancelRequest, ConfirmationDetails, Message -from karrio.core.utils import Serializable -from karrio.providers.easypost.error import parse_error_response -from karrio.providers.easypost.utils import Settings +import typing import karrio.lib as lib +import karrio.core.units as units +import karrio.core.models as models +import karrio.providers.easypost.error as provider_error +import karrio.providers.easypost.units as provider_units +import karrio.providers.easypost.utils as provider_utils def parse_shipment_cancel_response( _response: lib.Deserializable[dict], - settings: Settings, -) -> Tuple[ConfirmationDetails, List[Message]]: + settings: provider_utils.Settings, +) -> typing.Tuple[models.ConfirmationDetails, typing.List[models.Message]]: response = _response.deserialize() status = response.get("status") - errors = [parse_error_response(response, settings)] if "error" in response else [] + errors = provider_error.parse_error_response(response, settings) - details = ConfirmationDetails( + details = models.ConfirmationDetails( carrier_id=settings.carrier_id, carrier_name=settings.carrier_name, success=status != "rejected", @@ -24,5 +25,7 @@ def parse_shipment_cancel_response( return details, errors -def shipment_cancel_request(payload: ShipmentCancelRequest, _) -> Serializable: - return Serializable(payload.shipment_identifier) +def shipment_cancel_request( + payload: models.ShipmentCancelRequest, _ +) -> lib.Serializable: + return lib.Serializable(payload.shipment_identifier) diff --git a/modules/connectors/easypost/karrio/providers/easypost/shipment/create.py b/modules/connectors/easypost/karrio/providers/easypost/shipment/create.py index 041ef7b9e7..ed00ce0723 100644 --- a/modules/connectors/easypost/karrio/providers/easypost/shipment/create.py +++ b/modules/connectors/easypost/karrio/providers/easypost/shipment/create.py @@ -1,5 +1,5 @@ import karrio.schemas.easypost.shipment_request as easypost -from karrio.schemas.easypost.shipments_response import Shipment +import karrio.schemas.easypost.shipments_response as shipping import typing import karrio.lib as lib @@ -15,11 +15,7 @@ def parse_shipment_response( settings: provider_utils.Settings, ) -> typing.Tuple[models.ShipmentDetails, typing.List[models.Message]]: response = _response.deserialize() - errors = ( - [provider_error.parse_error_response(response, settings)] - if "error" in response - else [] - ) + errors = provider_error.parse_error_response(response, settings) shipment = _extract_details(response, settings) if "error" not in response else None return shipment, errors @@ -28,7 +24,7 @@ def parse_shipment_response( def _extract_details( response: dict, settings: provider_utils.Settings ) -> models.ShipmentDetails: - shipment = lib.to_object(Shipment, response) + shipment = lib.to_object(shipping.Shipment, response) label_type = shipment.postage_label.label_file_type.split("/")[-1] label = provider_utils.download_label(shipment.postage_label.label_url) diff --git a/modules/connectors/easypost/karrio/providers/easypost/tracking.py b/modules/connectors/easypost/karrio/providers/easypost/tracking.py index fbf6719a81..26929eab01 100644 --- a/modules/connectors/easypost/karrio/providers/easypost/tracking.py +++ b/modules/connectors/easypost/karrio/providers/easypost/tracking.py @@ -12,11 +12,14 @@ def parse_tracking_response( settings: provider_utils.Settings, ) -> typing.Tuple[typing.List[models.TrackingDetails], typing.List[models.Message]]: responses = _responses.deserialize() - errors = [ - error.parse_error_response(response, settings, dict(tracking_number=code)) - for code, response in responses - if "error" in response - ] + errors: typing.List[models.Message] = sum( + [ + error.parse_error_response(response, settings, tracking_number=code) + for code, response in responses + if "error" in response + ], + start=[], + ) trackers = [ _extract_details(response, settings) for _, response in responses diff --git a/modules/connectors/easypost/karrio/providers/easypost/units.py b/modules/connectors/easypost/karrio/providers/easypost/units.py index 1538065802..d4217bde60 100644 --- a/modules/connectors/easypost/karrio/providers/easypost/units.py +++ b/modules/connectors/easypost/karrio/providers/easypost/units.py @@ -21,7 +21,7 @@ class PaymentType(lib.StrEnum): recipient = receiver -class PackagingType(lib.StrEnum): +class PackagingType(lib.Enum): easypost_dhl_jumbo_document = "JumboDocument" easypost_dhl_jumbo_parcel = "JumboParcel" easypost_dhl_document = "Document" @@ -141,7 +141,7 @@ class PackagingType(lib.StrEnum): easyport_usps_pmod_sack = "PMODSack" """ Unified Packaging type mapping """ - envelope = "" + envelope = None pak = envelope tube = envelope pallet = envelope diff --git a/modules/connectors/easypost/schemas/shipments_response.json b/modules/connectors/easypost/schemas/shipments_response.json index bfaf9bd641..94fdf17223 100644 --- a/modules/connectors/easypost/schemas/shipments_response.json +++ b/modules/connectors/easypost/schemas/shipments_response.json @@ -286,4 +286,4 @@ "updated_at": "2013-04-22T05:40:57Z" } ] -} +} \ No newline at end of file diff --git a/modules/connectors/easypost/tests/easypost/test_rate.py b/modules/connectors/easypost/tests/easypost/test_rate.py index 673b6948a5..2b9ad4732a 100644 --- a/modules/connectors/easypost/tests/easypost/test_rate.py +++ b/modules/connectors/easypost/tests/easypost/test_rate.py @@ -17,7 +17,7 @@ def test_create_rate_request(self): self.assertEqual(request.serialize(), RateRequestJSON) def test_get_rate(self): - with patch("karrio.mappers.easypost.proxy.http") as mock: + with patch("karrio.mappers.easypost.proxy.lib.request") as mock: mock.return_value = "{}" Rating.fetch(self.RateRequest).from_(gateway) @@ -27,14 +27,14 @@ def test_get_rate(self): ) def test_parse_rate_response(self): - with patch("karrio.mappers.easypost.proxy.http") as mock: + with patch("karrio.mappers.easypost.proxy.lib.request") as mock: mock.return_value = RateResponseJSON parsed_response = Rating.fetch(self.RateRequest).from_(gateway).parse() self.assertListEqual(DP.to_dict(parsed_response), ParsedRateResponse) def test_parse_error_response(self): - with patch("karrio.mappers.easypost.proxy.http") as mock: + with patch("karrio.mappers.easypost.proxy.lib.request") as mock: mock.return_value = ErrorResponseJSON parsed_response = Rating.fetch(self.RateRequest).from_(gateway).parse() diff --git a/modules/connectors/easypost/tests/easypost/test_shipment.py b/modules/connectors/easypost/tests/easypost/test_shipment.py index 17a74db71d..a4a3017b3b 100644 --- a/modules/connectors/easypost/tests/easypost/test_shipment.py +++ b/modules/connectors/easypost/tests/easypost/test_shipment.py @@ -24,7 +24,7 @@ def test_create_cancel_shipment_request(self): self.assertEqual(request.serialize(), CancelShipmentRequestJSON) def test_create_shipment(self): - with patch("karrio.mappers.easypost.proxy.http") as mocks: + with patch("karrio.mappers.easypost.proxy.lib.request") as mocks: mocks.side_effect = [ShipmentResponseJSON, BuyShipmentResponseJSON] Shipment.create(self.ShipmentRequest).from_(gateway) @@ -40,7 +40,7 @@ def test_create_shipment(self): ) def test_create_cancel_shipment(self): - with patch("karrio.mappers.easypost.proxy.http") as mock: + with patch("karrio.mappers.easypost.proxy.lib.request") as mock: mock.return_value = "{}" Shipment.cancel(self.ShipmentCancelRequest).from_(gateway) @@ -50,7 +50,7 @@ def test_create_cancel_shipment(self): ) def test_parse_shipment_response(self): - with patch("karrio.mappers.easypost.proxy.http") as mocks: + with patch("karrio.mappers.easypost.proxy.lib.request") as mocks: mocks.side_effect = [ShipmentResponseJSON, BuyShipmentResponseJSON] response = Shipment.create(self.ShipmentRequest).from_(gateway) @@ -63,7 +63,7 @@ def test_parse_shipment_response(self): ) def test_parse_cancel_shipment_response(self): - with patch("karrio.mappers.easypost.proxy.http") as mock: + with patch("karrio.mappers.easypost.proxy.lib.request") as mock: mock.return_value = CancelShipmentResponseJSON parsed_response = ( Shipment.cancel(self.ShipmentCancelRequest).from_(gateway).parse() diff --git a/modules/connectors/easypost/tests/easypost/test_tracking.py b/modules/connectors/easypost/tests/easypost/test_tracking.py index 803e0ffd4a..8cd5cbc107 100644 --- a/modules/connectors/easypost/tests/easypost/test_tracking.py +++ b/modules/connectors/easypost/tests/easypost/test_tracking.py @@ -17,7 +17,7 @@ def test_create_tracking_request(self): self.assertEqual(request.serialize(), TrackingRequestJSON) def test_get_tracking(self): - with patch("karrio.mappers.easypost.proxy.http") as mocks: + with patch("karrio.mappers.easypost.proxy.lib.request") as mocks: mocks.side_effect = ["{}", "{}"] Tracking.fetch(self.TrackingRequest).from_(gateway) @@ -33,7 +33,7 @@ def test_get_tracking(self): ) def test_parse_tracking_response(self): - with patch("karrio.mappers.easypost.proxy.http") as mocks: + with patch("karrio.mappers.easypost.proxy.lib.request") as mocks: mocks.side_effect = [TrackingResponseJSON, TrackingResponseJSON] parsed_response = ( Tracking.fetch(self.TrackingRequest).from_(gateway).parse() @@ -42,7 +42,7 @@ def test_parse_tracking_response(self): self.assertListEqual(DP.to_dict(parsed_response), ParsedTrackingResponse) def test_parse_error_response(self): - with patch("karrio.mappers.easypost.proxy.http") as mocks: + with patch("karrio.mappers.easypost.proxy.lib.request") as mocks: mocks.side_effect = [ErrorResponseJSON, ErrorResponseJSON] parsed_response = ( Tracking.fetch(self.TrackingRequest).from_(gateway).parse() From c43fc7a2f0e7d209b9a0521087691a18e3b90d74 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 13 Dec 2023 05:02:10 -0800 Subject: [PATCH 3/5] (fix) asendia_us ui connection configparameters --- packages/ui/modals/connect-provider-modal.tsx | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/ui/modals/connect-provider-modal.tsx b/packages/ui/modals/connect-provider-modal.tsx index 350a973e05..802cef74a2 100644 --- a/packages/ui/modals/connect-provider-modal.tsx +++ b/packages/ui/modals/connect-provider-modal.tsx @@ -548,6 +548,24 @@ export const ConnectProviderModal: React.FC = ({ className="is-small is-fullwidth" />} + {"sub_account" in connection_configs[carrier_name.toString()] && + } + + {"processing_location" in connection_configs[carrier_name.toString()] && + } + {"language_code" in connection_configs[carrier_name.toString()] && Date: Wed, 13 Dec 2023 05:03:24 -0800 Subject: [PATCH 4/5] (clean) up graphiql theme and shipment error message formatting to add easypost nested carrier info --- apps/dashboard/src/modules/Developers/graphiql.tsx | 2 +- packages/ui/components/notifier.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/modules/Developers/graphiql.tsx b/apps/dashboard/src/modules/Developers/graphiql.tsx index a2f264272c..c6a120ffeb 100644 --- a/apps/dashboard/src/modules/Developers/graphiql.tsx +++ b/apps/dashboard/src/modules/Developers/graphiql.tsx @@ -30,7 +30,7 @@ export default function Page(pageProps: any) { return (
- +
); diff --git a/packages/ui/components/notifier.tsx b/packages/ui/components/notifier.tsx index 964ee4f173..60059a0c3a 100644 --- a/packages/ui/components/notifier.tsx +++ b/packages/ui/components/notifier.tsx @@ -87,7 +87,7 @@ function renderError(msg: any, _: number): any { else if (Array.isArray(error) && error.length > 0) { return (error || []).map((msg: any, index: number) => { if (msg.carrier_name) { - return

{msg.carrier_name || msg.carrier_id || JSON.stringify(msg)} {msg.message}

; + return

{msg.carrier_name || msg.carrier_id || JSON.stringify(msg)} {msg.details?.carrier} {msg.message}

; } if (msg.details) { return <>{renderError(msg, 0)}; From 62cab8cd3b15a15eb01b7f2ed2570fb1b9e4850f Mon Sep 17 00:00:00 2001 From: Daniel K Date: Wed, 13 Dec 2023 05:11:49 -0800 Subject: [PATCH 5/5] (release) karrio 2023.9.5 --- README.md | 4 +- apps/api/karrio/server/VERSION | 2 +- bin/deploy-hobby | 4 +- bin/upgrade-hobby | 2 +- docker/docker-compose.yml | 6 +-- modules/connectors/dhl_express/setup.py | 2 +- modules/connectors/easypost/setup.py | 2 +- packages/types/rest/api.ts | 4 +- packages/types/rest/base.ts | 4 +- packages/types/rest/common.ts | 4 +- packages/types/rest/configuration.ts | 4 +- packages/types/rest/index.ts | 4 +- schemas/openapi.yml | 56 +++++++++++++++++++++---- 13 files changed, 71 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 04557aa7e8..a4f77c7321 100644 --- a/README.md +++ b/README.md @@ -89,10 +89,12 @@ We are an open-source alternative to expensive in-house carrier integration and ### Shipping for platforms With Karrio, you can extend your platform with native shipping capabilities. Improve merchants and customers experience on your Marketplace, eCommerce, ERP, WMS, OMS, 3PL and Logistics platform. +With Karrio, 3PLs and large volume shippers regain control over their shipping tech stack and processes. ### Shipping for enterprise -Karrio makes modern shipping accessible to brands, retailers as well as enterprises in regulated industries. +Karrio makes modern shipping accessible to brands, retailers as well as businesses in regulated industries. +Ideal for pharmacy shipping where compliance is a must. ## Support diff --git a/apps/api/karrio/server/VERSION b/apps/api/karrio/server/VERSION index 6895b410d8..a1e3a66be3 100644 --- a/apps/api/karrio/server/VERSION +++ b/apps/api/karrio/server/VERSION @@ -1 +1 @@ -2023.9.4 \ No newline at end of file +2023.9.5 \ No newline at end of file diff --git a/bin/deploy-hobby b/bin/deploy-hobby index c520df3ca4..b849dc390b 100755 --- a/bin/deploy-hobby +++ b/bin/deploy-hobby @@ -2,7 +2,7 @@ set -e -export KARRIO_TAG="${KARRIO_TAG:-2023.9.4}" +export KARRIO_TAG="${KARRIO_TAG:-2023.9.5}" export SENTRY_DSN="${SENTRY_DSN:-'https://public@sentry.example.com/1'}" SECRET_KEY=$(head -c 28 /dev/urandom | sha224sum -b | head -c 56) @@ -23,7 +23,7 @@ if ! [ -z "$1" ] then export KARRIO_TAG=$1 else -echo "What version of Karrio would you like to install? (We default to '2023.9.4')" +echo "What version of Karrio would you like to install? (We default to '2023.9.5')" echo "You can check out available versions here: https://hub.docker.com/r/karrio/server/tags" read -r KARRIO_TAG_READ if [ -z "$KARRIO_TAG_READ" ] diff --git a/bin/upgrade-hobby b/bin/upgrade-hobby index dbdd04a8fd..502a80f8b6 100755 --- a/bin/upgrade-hobby +++ b/bin/upgrade-hobby @@ -44,7 +44,7 @@ else fi [[ -f ".env" ]] && export $(cat .env | xargs) || ( echo "No .env file found. Please create it with SECRET_KEY and DOMAIN set." && exit 1) -export KARRIO_TAG="${KARRIO_TAG:-2023.9.4}" +export KARRIO_TAG="${KARRIO_TAG:-2023.9.5}" # get karrio scripts mkdir -p ./karrio diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 552d3a6f9d..92d1a503d2 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -3,7 +3,7 @@ version: "3" services: api: container_name: karrio.api - image: karrio.docker.scarf.sh/karrio/server:2023.9.4 + image: karrio.docker.scarf.sh/karrio/server:2023.9.5 restart: unless-stopped ports: - ${KARRIO_HTTP_PORT}:${KARRIO_HTTP_PORT} @@ -25,7 +25,7 @@ services: worker: container_name: karrio.worker - image: karrio.docker.scarf.sh/karrio/server:2023.9.4 + image: karrio.docker.scarf.sh/karrio/server:2023.9.5 restart: unless-stopped depends_on: - db @@ -46,7 +46,7 @@ services: dashboard: container_name: karrio.dashboard - image: karrio.docker.scarf.sh/karrio/dashboard:2023.9.4 + image: karrio.docker.scarf.sh/karrio/dashboard:2023.9.5 restart: unless-stopped ports: - ${DASHBOARD_PORT}:3000/tcp diff --git a/modules/connectors/dhl_express/setup.py b/modules/connectors/dhl_express/setup.py index 19e1542277..17f0d3175f 100644 --- a/modules/connectors/dhl_express/setup.py +++ b/modules/connectors/dhl_express/setup.py @@ -5,7 +5,7 @@ setup( name="karrio.dhl_express", - version="2023.9.3", + version="2023.9.5", description="Karrio - DHL Express Shipping Extension", long_description=long_description, long_description_content_type="text/markdown", diff --git a/modules/connectors/easypost/setup.py b/modules/connectors/easypost/setup.py index 59ffeb2d28..073d65da9e 100644 --- a/modules/connectors/easypost/setup.py +++ b/modules/connectors/easypost/setup.py @@ -5,7 +5,7 @@ setup( name="karrio.easypost", - version="2023.9.2", + version="2023.9.5", description="Karrio - EasyPost Shipping extension", long_description=long_description, long_description_content_type="text/markdown", diff --git a/packages/types/rest/api.ts b/packages/types/rest/api.ts index 5995149132..bb83be8328 100644 --- a/packages/types/rest/api.ts +++ b/packages/types/rest/api.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.3`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.5`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2023.9.3 + * The version of the OpenAPI document: 2023.9.5 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/base.ts b/packages/types/rest/base.ts index a557e229cf..a8db67aa8d 100644 --- a/packages/types/rest/base.ts +++ b/packages/types/rest/base.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.3`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.5`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2023.9.3 + * The version of the OpenAPI document: 2023.9.5 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/common.ts b/packages/types/rest/common.ts index aaf84a0d91..4ca95bb817 100644 --- a/packages/types/rest/common.ts +++ b/packages/types/rest/common.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.3`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.5`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2023.9.3 + * The version of the OpenAPI document: 2023.9.5 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/configuration.ts b/packages/types/rest/configuration.ts index e654a9d1f1..61d51bcedb 100644 --- a/packages/types/rest/configuration.ts +++ b/packages/types/rest/configuration.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.3`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.5`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2023.9.3 + * The version of the OpenAPI document: 2023.9.5 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/types/rest/index.ts b/packages/types/rest/index.ts index 0b786ea953..77cba43ec6 100644 --- a/packages/types/rest/index.ts +++ b/packages/types/rest/index.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.3`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. + * ## API Reference Karrio is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services. The Karrio API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The Karrio API differs for every account as we release new versions. These docs are customized to your version of the API. ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. The current version is `2023.9.5`. Read our API changelog and to learn more about backwards compatibility. As a precaution, use API versioning to check a new API version before committing to an upgrade. ## Environments The Karrio API offer the possibility to create and retrieve certain objects in `test_mode`. In development, it is therefore possible to add carrier connections, get live rates, buy labels, create trackers and schedule pickups in `test_mode`. ## Pagination All top-level API resources have support for bulk fetches via \"list\" API methods. For instance, you can list addresses, list shipments, and list trackers. These list API methods share a common structure, taking at least these two parameters: limit, and offset. Karrio utilizes offset-based pagination via the offset and limit parameters. Both parameters take a number as value (see below) and return objects in reverse chronological order. The offset parameter returns objects listed after an index. The limit parameter take a limit on the number of objects to be returned from 1 to 100. ```json { \"count\": 100, \"next\": \"/v1/shipments?limit=25&offset=50\", \"previous\": \"/v1/shipments?limit=25&offset=25\", \"results\": [ { ... }, ] } ``` ## Metadata Updateable Karrio objects—including Shipment and Order—have a metadata parameter. You can use this parameter to attach key-value data to these Karrio objects. Metadata is useful for storing additional, structured information on an object. As an example, you could store your user\'s full name and corresponding unique identifier from your system on a Karrio Order object. Do not store any sensitive information as metadata. ## Authentication API keys are used to authenticate requests. You can view and manage your API keys in the Dashboard. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. Authentication to the API is performed via HTTP Basic Auth. Provide your API token as the basic auth username value. You do not need to provide a password. ```shell $ curl https://instance.api.com/v1/shipments \\ -u key_xxxxxx: # The colon prevents curl from asking for a password. ``` If you need to authenticate via bearer auth (e.g., for a cross-origin request), use `-H \"Authorization: Token key_xxxxxx\"` instead of `-u key_xxxxxx`. All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. * - * The version of the OpenAPI document: 2023.9.3 + * The version of the OpenAPI document: 2023.9.5 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/schemas/openapi.yml b/schemas/openapi.yml index 4d3674e329..9f3a3aab56 100644 --- a/schemas/openapi.yml +++ b/schemas/openapi.yml @@ -16,7 +16,7 @@ info: ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. - The current version is `2023.9.3`. + The current version is `2023.9.5`. Read our API changelog and to learn more about backwards compatibility. @@ -86,7 +86,7 @@ info: All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests without authentication will also fail. title: Karrio API - version: 2023.9.3 + version: 2023.9.5 paths: /: get: @@ -125,8 +125,6 @@ paths: TRACKER_DATA_RETENTION: true SHIPMENT_DATA_RETENTION: true API_LOGS_DATA_RETENTION: true - ORG_LEVEL_BILLING: true - TENANT_LEVEL_BILLING: true description: '' /api/token: post: @@ -2337,8 +2335,6 @@ paths: TRACKER_DATA_RETENTION: true SHIPMENT_DATA_RETENTION: true API_LOGS_DATA_RETENTION: true - ORG_LEVEL_BILLING: true - TENANT_LEVEL_BILLING: true ADDRESS_AUTO_COMPLETE: {} countries: {} currencies: {} @@ -3627,6 +3623,7 @@ components: - ZM - ZW type: string + x-spec-enum-id: f907b2af5d9d32f1 description: |- The address country code @@ -4193,6 +4190,7 @@ components: - ZM - ZW type: string + x-spec-enum-id: f907b2af5d9d32f1 description: |- The address country code @@ -4524,6 +4522,7 @@ components: - completed - completed_with_errors type: string + x-spec-enum-id: 75e3c72297e66209 description: |- The batch operation resource status @@ -4559,6 +4558,7 @@ components: * `failed` - failed * `completed` - completed * `completed_with_errors` - completed_with_errors + x-spec-enum-id: 75e3c72297e66209 resource_type: enum: - orders @@ -4571,6 +4571,7 @@ components: * `shipments` - shipments * `trackers` - trackers * `billing` - billing + x-spec-enum-id: 11343e2af644580f resources: type: array items: @@ -4710,6 +4711,7 @@ components: - usps_international - zoom2u type: string + x-spec-enum-id: 3be4c2d55869de9e description: |- Indicates a carrier (type) @@ -4813,6 +4815,7 @@ components: - OZ - G type: string + x-spec-enum-id: 2aa755cf319c6df9 description: |- The commodity's weight unit @@ -4996,6 +4999,7 @@ components: - ZAR - null type: string + x-spec-enum-id: f0290aeafc544e9d nullable: true description: |- The currency of the commodity value amount @@ -5381,6 +5385,7 @@ components: - ZW - null type: string + x-spec-enum-id: f907b2af5d9d32f1 nullable: true description: |- The origin or manufacture country @@ -5653,6 +5658,7 @@ components: - OZ - G type: string + x-spec-enum-id: 2aa755cf319c6df9 description: |- The commodity's weight unit @@ -5836,6 +5842,7 @@ components: - ZAR - null type: string + x-spec-enum-id: f0290aeafc544e9d nullable: true description: |- The currency of the commodity value amount @@ -6221,6 +6228,7 @@ components: - ZW - null type: string + x-spec-enum-id: f907b2af5d9d32f1 nullable: true description: |- The origin or manufacture country @@ -6515,6 +6523,7 @@ components: * `merchandise` - merchandise * `return_merchandise` - return_merchandise * `other` - other + x-spec-enum-id: 8bc1717e39f37f69 nullable: true content_description: type: string @@ -6536,6 +6545,7 @@ components: - FOB - null type: string + x-spec-enum-id: 544ac66d62cbdedb nullable: true description: |- The customs 'term of trade' also known as 'incoterm' @@ -6626,6 +6636,7 @@ components: * `merchandise` - merchandise * `return_merchandise` - return_merchandise * `other` - other + x-spec-enum-id: 8bc1717e39f37f69 nullable: true content_description: type: string @@ -6647,6 +6658,7 @@ components: - FOB - null type: string + x-spec-enum-id: 544ac66d62cbdedb nullable: true description: |- The customs 'term of trade' also known as 'incoterm' @@ -6849,6 +6861,7 @@ components: - '' - null type: string + x-spec-enum-id: 4d1fdef60a9538c0 nullable: true description: |- The duty payer @@ -7004,6 +7017,7 @@ components: - '' - null type: string + x-spec-enum-id: f0290aeafc544e9d nullable: true description: |- The declared value currency @@ -7193,6 +7207,7 @@ components: - OZ - G type: string + x-spec-enum-id: 2aa755cf319c6df9 description: |- The commodity's weight unit @@ -7376,6 +7391,7 @@ components: - ZAR - null type: string + x-spec-enum-id: f0290aeafc544e9d nullable: true description: |- The currency of the commodity value amount @@ -7761,6 +7777,7 @@ components: - ZW - null type: string + x-spec-enum-id: f907b2af5d9d32f1 nullable: true description: |- The origin or manufacture country @@ -8113,6 +8130,7 @@ components: - delivered - partial type: string + x-spec-enum-id: 4993b3ade2f339b3 default: unfulfilled description: |- The order status. @@ -8339,6 +8357,7 @@ components: - OZ - G type: string + x-spec-enum-id: 2aa755cf319c6df9 description: |- The parcel's weight unit @@ -8352,6 +8371,7 @@ components: - IN - null type: string + x-spec-enum-id: 41993cb8117c279c nullable: true description: |- The parcel's dimension unit @@ -8447,6 +8467,7 @@ components: - OZ - G type: string + x-spec-enum-id: 2aa755cf319c6df9 description: |- The parcel's weight unit @@ -8460,6 +8481,7 @@ components: - IN - null type: string + x-spec-enum-id: 41993cb8117c279c nullable: true description: |- The parcel's dimension unit @@ -8785,6 +8807,7 @@ components: - ZM - ZW type: string + x-spec-enum-id: f907b2af5d9d32f1 description: |- The address country code @@ -9104,6 +9127,7 @@ components: * `merchandise` - merchandise * `return_merchandise` - return_merchandise * `other` - other + x-spec-enum-id: 8bc1717e39f37f69 nullable: true content_description: type: string @@ -9125,6 +9149,7 @@ components: - FOB - null type: string + x-spec-enum-id: 544ac66d62cbdedb nullable: true description: |- The customs 'term of trade' also known as 'incoterm' @@ -9233,6 +9258,7 @@ components: - OZ - G type: string + x-spec-enum-id: 2aa755cf319c6df9 description: |- The parcel's weight unit @@ -9246,6 +9272,7 @@ components: - IN - null type: string + x-spec-enum-id: 41993cb8117c279c nullable: true description: |- The parcel's dimension unit @@ -9328,6 +9355,7 @@ components: * `batch_failed` - batch_failed * `batch_running` - batch_running * `batch_completed` - batch_completed + x-spec-enum-id: 516a21d18ffb1926 description: The list of events to enable for this endpoint. disabled: type: boolean @@ -9342,6 +9370,7 @@ components: - recipient - third_party type: string + x-spec-enum-id: 4d1fdef60a9538c0 default: sender description: |- The payor type @@ -9497,6 +9526,7 @@ components: - '' - null type: string + x-spec-enum-id: f0290aeafc544e9d nullable: true description: |- The payment amount currency @@ -10218,6 +10248,7 @@ components: - '' - null type: string + x-spec-enum-id: d10a5d5e08394b13 nullable: true description: |- The shipment label file type. @@ -10265,6 +10296,7 @@ components: - out_for_delivery - delivery_failed type: string + x-spec-enum-id: e418e9eb782a00a9 default: draft description: |- The current Shipment status @@ -10420,6 +10452,7 @@ components: - ZPL - PNG type: string + x-spec-enum-id: d10a5d5e08394b13 default: PDF description: |- The shipment label file type. @@ -10490,6 +10523,7 @@ components: - ZPL - PNG type: string + x-spec-enum-id: d10a5d5e08394b13 default: PDF description: |- The shipment label file type. @@ -10549,6 +10583,7 @@ components: - ZPL - PNG type: string + x-spec-enum-id: d10a5d5e08394b13 default: PDF description: |- The shipment label file type. @@ -10651,6 +10686,7 @@ components: - ZPL - PNG type: string + x-spec-enum-id: d10a5d5e08394b13 default: PDF description: |- The shipment label file type. @@ -10773,6 +10809,7 @@ components: - '' - null type: string + x-spec-enum-id: d10a5d5e08394b13 nullable: true description: |- The shipment label file type. @@ -10820,6 +10857,7 @@ components: - out_for_delivery - delivery_failed type: string + x-spec-enum-id: e418e9eb782a00a9 default: draft description: |- The current Shipment status @@ -10994,6 +11032,7 @@ components: - usps_international - zoom2u type: string + x-spec-enum-id: 18c5d0ed9e85ec22 description: |- The tracking carrier @@ -11235,6 +11274,7 @@ components: - ready_for_pickup - delivery_failed type: string + x-spec-enum-id: e5df506dfd95c41b default: pending description: |- The current tracking status @@ -11348,6 +11388,7 @@ components: * `batch_failed` - batch_failed * `batch_running` - batch_running * `batch_completed` - batch_completed + x-spec-enum-id: 516a21d18ffb1926 description: The list of events to enable for this endpoint. disabled: type: boolean @@ -11426,6 +11467,7 @@ components: * `batch_failed` - batch_failed * `batch_running` - batch_running * `batch_completed` - batch_completed + x-spec-enum-id: 516a21d18ffb1926 description: The list of events to enable for this endpoint. disabled: type: boolean @@ -12720,7 +12762,7 @@ tags: | dhl_express_envelope | X | | dhl_express_12_00_nondoc | Y | | dhl_destination_charges | Z | - | dhl_express_all | | + | dhl_express_all | None | ### Colissimo | Code | Service Name |