From 379bf0f0fff29c83c2da2acc76442dd463d3297f Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 24 Mar 2024 13:13:08 -0700 Subject: [PATCH 1/2] fix: sscc calculation for TGE integration --- .../modules/Manifests/create_manifests.tsx | 2 +- .../tge/karrio/providers/tge/utils.py | 21 +++++++++++-------- .../karrio/server/providers/models/carrier.py | 6 ++++++ packages/ui/modals/create-manifest-modal.tsx | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/apps/dashboard/src/modules/Manifests/create_manifests.tsx b/apps/dashboard/src/modules/Manifests/create_manifests.tsx index 67b5aa1c9a..0003d5ac1a 100644 --- a/apps/dashboard/src/modules/Manifests/create_manifests.tsx +++ b/apps/dashboard/src/modules/Manifests/create_manifests.tsx @@ -14,12 +14,12 @@ import { useLoader } from '@karrio/ui/components/loader'; import { AppLink } from '@karrio/ui/components/app-link'; import { ModalProvider } from '@karrio/ui/modals/modal'; import { useShipments } from '@karrio/hooks/shipment'; +import { ManifestData } from '@karrio/types/rest/api'; import { bundleContexts } from '@karrio/hooks/utils'; import { Spinner } from '@karrio/ui/components'; import { useRouter } from 'next/router'; import Head from 'next/head'; import React from 'react'; -import { ManifestData } from '@karrio/types/rest/api'; export { getServerSideProps } from "@/context/main"; diff --git a/modules/connectors/tge/karrio/providers/tge/utils.py b/modules/connectors/tge/karrio/providers/tge/utils.py index c005da6cac..9872452031 100644 --- a/modules/connectors/tge/karrio/providers/tge/utils.py +++ b/modules/connectors/tge/karrio/providers/tge/utils.py @@ -52,6 +52,10 @@ def connection_config(self) -> lib.units.Options: def next_shipment_identifiers( self, options: lib.units.Options, package_count: int ) -> typing.Tuple[str, list, int, int]: + # get state from cache + cache_key = f"{self.carrier_name}|{self.api_key}" + state = self.cache.get(cache_key) or {} + sscc_gs1 = lib.to_int(lib.text(self.connection_config.SSCC_GS1.state) or "") ship_gs1 = lib.to_int(lib.text(self.connection_config.SHIP_GS1.state) or "") sscc_count = ( @@ -80,22 +84,19 @@ def next_shipment_identifiers( ) # save in cache - cache_key = f"{self.carrier_name}|{self.api_key}" - state = self.cache.get(cache_key) or {} - - sscc_count = sscc_count + package_count - shipment_count = shipment_count + 1 + _sscc_count = sscc_count + package_count + _shipment_count = shipment_count + 1 self.cache.set( cache_key, - {**state, "sscc_count": sscc_count, "shipment_count": shipment_count}, + {**state, "sscc_count": _sscc_count, "shipment_count": _shipment_count}, ) return ( ShipmentID, SSCCs, - shipment_count, - sscc_count, + _shipment_count, + _sscc_count, ) @@ -129,6 +130,8 @@ def calculate_sscc(gs1, sscc: int, index: int) -> str: _current = [int(_) for _ in f"{gs1}{_new_sscc}".zfill(17)] _odd_sum = sum([int(x) for _, x in enumerate(_current) if _ % 2 == 0]) _even_sum = sum([int(x) for _, x in enumerate(_current) if _ % 2 != 0]) - _digit = 100 - ((_odd_sum * 3) + _even_sum) + _sscc_sum = (_odd_sum * 3) + _even_sum + _nearest_multiple_of_ten = _sscc_sum + 10 - (_sscc_sum % 10) + _digit = _nearest_multiple_of_ten - _sscc_sum return f"{''.join([str(_) for _ in _current])}{_digit}".zfill(18) diff --git a/modules/core/karrio/server/providers/models/carrier.py b/modules/core/karrio/server/providers/models/carrier.py index bc5e00da4f..d1ca4aea66 100644 --- a/modules/core/karrio/server/providers/models/carrier.py +++ b/modules/core/karrio/server/providers/models/carrier.py @@ -151,6 +151,12 @@ def data(self) -> datatypes.CarrierSettings: services=[forms.model_to_dict(s) for s in self.settings.service_list] ) + if hasattr(self.settings, "sscc_count"): + _computed_data.update(sscc_count=self.settings.sscc_count) + + if hasattr(self.settings, "shipment_count"): + _computed_data.update(shipment_count=self.settings.shipment_count) + if hasattr(self.settings, "cache"): _computed_data.update(cache=self.settings.cache) diff --git a/packages/ui/modals/create-manifest-modal.tsx b/packages/ui/modals/create-manifest-modal.tsx index 4e6f108d94..7d762d87b7 100644 --- a/packages/ui/modals/create-manifest-modal.tsx +++ b/packages/ui/modals/create-manifest-modal.tsx @@ -128,7 +128,7 @@ export const CreateManifestModal: React.FCCancel From ef252f70eef20009922ed4f91f708b6c67d63ce2 Mon Sep 17 00:00:00 2001 From: Daniel K Date: Sun, 24 Mar 2024 13:32:23 -0700 Subject: [PATCH 2/2] release: patch 2024.2.5 --- apps/api/karrio/server/VERSION | 2 +- bin/deploy-hobby | 4 ++-- bin/upgrade-hobby | 2 +- docker/docker-compose.yml | 6 +++--- modules/connectors/tge/setup.py | 2 +- modules/core/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 | 4 ++-- 12 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/api/karrio/server/VERSION b/apps/api/karrio/server/VERSION index d8251839c2..cdc10fd53c 100644 --- a/apps/api/karrio/server/VERSION +++ b/apps/api/karrio/server/VERSION @@ -1 +1 @@ -2024.2.4 \ No newline at end of file +2024.2.5 \ No newline at end of file diff --git a/bin/deploy-hobby b/bin/deploy-hobby index 898d5745d4..76a6c07449 100755 --- a/bin/deploy-hobby +++ b/bin/deploy-hobby @@ -2,7 +2,7 @@ set -e -export KARRIO_TAG="${KARRIO_TAG:-2024.2.4}" +export KARRIO_TAG="${KARRIO_TAG:-2024.2.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 '2024.2.4')" +echo "What version of Karrio would you like to install? (We default to '2024.2.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 58e8385bd6..7271e0199c 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.2.4}" +export KARRIO_TAG="${KARRIO_TAG:-2024.2.5}" # get karrio scripts mkdir -p ./karrio diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 269d86898f..c7161ccf68 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:2024.2.4 + image: karrio.docker.scarf.sh/karrio/server:2024.2.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:2024.2.4 + image: karrio.docker.scarf.sh/karrio/server:2024.2.5 restart: unless-stopped depends_on: - db @@ -46,7 +46,7 @@ services: dashboard: container_name: karrio.dashboard - image: karrio.docker.scarf.sh/karrio/dashboard:2024.2.4 + image: karrio.docker.scarf.sh/karrio/dashboard:2024.2.5 restart: unless-stopped ports: - ${DASHBOARD_PORT}:3000/tcp diff --git a/modules/connectors/tge/setup.py b/modules/connectors/tge/setup.py index 980c7887f6..9236381897 100644 --- a/modules/connectors/tge/setup.py +++ b/modules/connectors/tge/setup.py @@ -7,7 +7,7 @@ setup( name="karrio.tge", - version="2024.2.3", + version="2024.2.5", description="Karrio - TGE Shipping Extension", long_description=long_description, long_description_content_type="text/markdown", diff --git a/modules/core/setup.py b/modules/core/setup.py index 0882fa0b06..d740a0c6d2 100644 --- a/modules/core/setup.py +++ b/modules/core/setup.py @@ -5,7 +5,7 @@ setup( name="karrio.server.core", - version="2024.2.3", + version="2024.2.5", description="Multi-carrier shipping API Core module", 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 6205812a21..dba20f0bee 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 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.2.3`. 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. + * ## API Reference Karrio is an open source 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.2.5`. 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.2.3 + * The version of the OpenAPI document: 2024.2.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 579dd85cc0..b3151ae87a 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 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.2.3`. 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. + * ## API Reference Karrio is an open source 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.2.5`. 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.2.3 + * The version of the OpenAPI document: 2024.2.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 c9e4c23c03..e295ff2b1e 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 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.2.3`. 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. + * ## API Reference Karrio is an open source 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.2.5`. 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.2.3 + * The version of the OpenAPI document: 2024.2.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 fb9aa554ae..0609c426a9 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 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.2.3`. 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. + * ## API Reference Karrio is an open source 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.2.5`. 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.2.3 + * The version of the OpenAPI document: 2024.2.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 404fa0d130..914ae97be8 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 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.2.3`. 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. + * ## API Reference Karrio is an open source 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.2.5`. 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.2.3 + * The version of the OpenAPI document: 2024.2.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 82807f9e77..65d64b6378 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 `2024.2.4`. + The current version is `2024.2.5`. Read our API changelog 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: 2024.2.4 + version: 2024.2.5 paths: /: get: