From a1cd3794752438f7df376d0b198a99bfe065df70 Mon Sep 17 00:00:00 2001 From: Jacob Shilitz Date: Mon, 19 Aug 2024 16:39:18 -0400 Subject: [PATCH 1/4] Fix eShipper server URL for production mode Updated the `server_url` property to return the correct URL based on the `test_mode` flag. This ensures that the production and test environments are correctly targeted. --- modules/connectors/eshipper/karrio/providers/eshipper/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/connectors/eshipper/karrio/providers/eshipper/utils.py b/modules/connectors/eshipper/karrio/providers/eshipper/utils.py index 983776c046..0ac3c986b2 100644 --- a/modules/connectors/eshipper/karrio/providers/eshipper/utils.py +++ b/modules/connectors/eshipper/karrio/providers/eshipper/utils.py @@ -16,7 +16,7 @@ def carrier_name(self): @property def server_url(self): - return "https://uu2.eshipper.com" + return "https://uu2.eshipper.com" if self.test_mode else "https://ww2.eshipper.com" @property def access_token(self): From a0ed6cf4481298fe53452250894520167ba1c8c4 Mon Sep 17 00:00:00 2001 From: Jacob Shilitz Date: Mon, 19 Aug 2024 17:03:54 -0400 Subject: [PATCH 2/4] Convert label type to uppercase during shipment creation This modification ensures the label type generated during the shipment creation process in the eshipper module is always in uppercase format. This helps in maintaining uniformity in format and avoids possible case sensitivity problems. --- .../eshipper/karrio/providers/eshipper/shipment/create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/connectors/eshipper/karrio/providers/eshipper/shipment/create.py b/modules/connectors/eshipper/karrio/providers/eshipper/shipment/create.py index 39d5aec73f..3e89c7cbde 100644 --- a/modules/connectors/eshipper/karrio/providers/eshipper/shipment/create.py +++ b/modules/connectors/eshipper/karrio/providers/eshipper/shipment/create.py @@ -27,7 +27,7 @@ def _extract_details( settings: provider_utils.Settings, ) -> models.ShipmentDetails: shipment = lib.to_object(shipping.ShippingResponseType, data) - label_type = next((_.type for _ in shipment.labelData.label), "PDF") + label_type = next((_.type for _ in shipment.labelData.label), "PDF").upper() label = lib.bundle_base64([_.data for _ in shipment.labelData.label], label_type) trackingNumbers = [_.trackingNumber for _ in shipment.packages] From 2030e58f36d7889c891b61ea182532f3b686941b Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 19 Aug 2024 19:23:14 -0700 Subject: [PATCH 3/4] feat: add karrio.lib to document template context --- modules/documents/karrio/server/documents/generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/documents/karrio/server/documents/generator.py b/modules/documents/karrio/server/documents/generator.py index c5cff16f48..8bd5591f05 100644 --- a/modules/documents/karrio/server/documents/generator.py +++ b/modules/documents/karrio/server/documents/generator.py @@ -47,7 +47,7 @@ def generate( [{"data": data}] if related_object is None else [] ) - filename = ( + filename = lib.identity( dict(filename=kwargs.get("doc_name")) if kwargs.get("doc_name") else {} ) @@ -55,15 +55,15 @@ def generate( content = PAGE_SEPARATOR.join( [ *[ - jinja_template.render(**ctx, units=UNITS, utils=utils) + jinja_template.render(**ctx, units=UNITS, utils=utils, lib=lib) for ctx in shipment_contexts ], *[ - jinja_template.render(**ctx, units=UNITS, utils=utils) + jinja_template.render(**ctx, units=UNITS, utils=utils, lib=lib) for ctx in order_contexts ], *[ - jinja_template.render(**ctx, units=UNITS, utils=utils) + jinja_template.render(**ctx, units=UNITS, utils=utils, lib=lib) for ctx in generic_contexts ], ] From 2ba42dc64003416c46ed37e28d95f052e2113c15 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 19 Aug 2024 19:29:00 -0700 Subject: [PATCH 4/4] release: 2024.6-rc29 --- apps/api/karrio/server/VERSION | 2 +- apps/www/openapi.yml | 4 ++-- bin/deploy-hobby | 4 ++-- bin/upgrade-hobby | 2 +- docker/docker-compose.yml | 6 +++--- packages/types/rest/api.ts | 4 ++-- schemas/openapi.yml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/api/karrio/server/VERSION b/apps/api/karrio/server/VERSION index 290d0aa630..cac3077b97 100644 --- a/apps/api/karrio/server/VERSION +++ b/apps/api/karrio/server/VERSION @@ -1 +1 @@ -2024.6-rc28 \ No newline at end of file +2024.6-rc29 \ No newline at end of file diff --git a/apps/www/openapi.yml b/apps/www/openapi.yml index 9fe5c98c13..52791051e1 100644 --- a/apps/www/openapi.yml +++ b/apps/www/openapi.yml @@ -14,7 +14,7 @@ info: ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. - The current version is `2024.6-rc28`. + The current version is `2024.6-rc29`. Read our API changelog to learn more about backwards compatibility. @@ -84,7 +84,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: 2024.6-rc28 + version: 2024.6-rc29 paths: /: get: diff --git a/bin/deploy-hobby b/bin/deploy-hobby index cc5e4a007d..c867ded7d4 100755 --- a/bin/deploy-hobby +++ b/bin/deploy-hobby @@ -2,7 +2,7 @@ set -e -export KARRIO_TAG="${KARRIO_TAG:-2024.6-rc28}" +export KARRIO_TAG="${KARRIO_TAG:-2024.6-rc29}" 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 '2024.6-rc28')" +echo "What version of Karrio would you like to install? (We default to '2024.6-rc29')" 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 f868c9c481..9e04b403a9 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:-2024.6-rc28}" +export KARRIO_TAG="${KARRIO_TAG:-2024.6-rc29}" # get karrio scripts mkdir -p ./karrio diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 449e68ffe1..1e0922a8fc 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,7 +1,7 @@ services: api: container_name: karrio.api - image: karrio.docker.scarf.sh/karrio/server:2024.6-rc28 + image: karrio.docker.scarf.sh/karrio/server:2024.6-rc29 restart: unless-stopped ports: - ${KARRIO_HTTP_PORT}:${KARRIO_HTTP_PORT} @@ -24,7 +24,7 @@ services: worker: container_name: karrio.worker - image: karrio.docker.scarf.sh/karrio/server:2024.6-rc28 + image: karrio.docker.scarf.sh/karrio/server:2024.6-rc29 restart: unless-stopped depends_on: - db @@ -44,7 +44,7 @@ services: dashboard: container_name: karrio.dashboard - image: karrio.docker.scarf.sh/karrio/dashboard:2024.6-rc28 + image: karrio.docker.scarf.sh/karrio/dashboard:2024.6-rc29 restart: unless-stopped ports: - ${DASHBOARD_PORT}:3000/tcp diff --git a/packages/types/rest/api.ts b/packages/types/rest/api.ts index 109e70468d..3822d83247 100644 --- a/packages/types/rest/api.ts +++ b/packages/types/rest/api.ts @@ -2,9 +2,9 @@ /* eslint-disable */ /** * Karrio API - * Karrio is a multi-carrier shipping API that simplifies the integration of logistics 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 `2024.6-rc28`. Read our API changelog 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. + * Karrio is a multi-carrier shipping API that simplifies the integration of logistics 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 `2024.6-rc29`. Read our API changelog 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: 2024.6-rc28 + * The version of the OpenAPI document: 2024.6-rc29 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/schemas/openapi.yml b/schemas/openapi.yml index 413e069411..1e26761a46 100644 --- a/schemas/openapi.yml +++ b/schemas/openapi.yml @@ -14,7 +14,7 @@ info: ## Versioning When backwards-incompatible changes are made to the API, a new, dated version is released. - The current version is `2024.6-rc28`. + The current version is `2024.6-rc29`. Read our API changelog to learn more about backwards compatibility. @@ -84,7 +84,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: 2024.6-rc28 + version: 2024.6-rc29 paths: /: get: