Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-candidate] Karrio 2024.12rc7 #738

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Karrio 2024.12rc7

## Changes

### Feat

- feat: clean up `SEKO` shipment meta to collecte delegated Carrier details

### Fix

- fix: document generator invalid closing statement


# Karrio 2024.12rc6

## Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/api/karrio/server/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.12rc6
2024.12rc7
4 changes: 2 additions & 2 deletions apps/www/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.12rc6`.
The current version is `2024.12rc7`.

Read our API changelog to learn more about backwards compatibility.

Expand Down Expand Up @@ -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.12rc6
version: 2024.12rc7
paths:
/:
get:
Expand Down
4 changes: 2 additions & 2 deletions bin/deploy-hobby
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

export KARRIO_TAG="${KARRIO_TAG:-2024.12rc6}"
export KARRIO_TAG="${KARRIO_TAG:-2024.12rc7}"
export SENTRY_DSN="${SENTRY_DSN:-'https://public@sentry.example.com/1'}"

SECRET_KEY=$(head -c 28 /dev/urandom | sha224sum -b | head -c 56)
Expand All @@ -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.12rc6')"
echo "What version of Karrio would you like to install? (We default to '2024.12rc7')"
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" ]
Expand Down
2 changes: 1 addition & 1 deletion bin/upgrade-hobby
Original file line number Diff line number Diff line change
Expand Up @@ -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.12rc6}"
export KARRIO_TAG="${KARRIO_TAG:-2024.12rc7}"

# get karrio scripts
mkdir -p ./karrio
Expand Down
2 changes: 1 addition & 1 deletion docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ REDIS_PORT=6379
# API - Configuration for the Nginx Reverse proxy.
############

KARRIO_TAG=2024.12rc6
KARRIO_TAG=2024.12rc7
KARRIO_HTTP_PORT=5002

############
Expand Down
2 changes: 1 addition & 1 deletion ee/insiders
14 changes: 8 additions & 6 deletions modules/connectors/seko/karrio/providers/seko/shipment/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ def _extract_details(
label_type=label_format,
docs=models.Documents(label=label),
meta=dict(
SiteId=details.SiteId,
carrier_tracking_link=TrackingUrls[0],
TrackingUrls=TrackingUrls,
ConsignmentId=ConsignmentIds[0],
ConsignmentIds=ConsignmentIds,
CarrierId=details.CarrierId,
CarrierName=details.CarrierName,
seko_site_id=details.SiteId,
tracking_urls=TrackingUrls,
consignment_id=ConsignmentIds[0],
consignment_ids=ConsignmentIds,
seko_carrier_id=details.CarrierId,
seko_carrier_name=details.CarrierName,
seko_carrier_type=details.CarrierType,
rate_provider=details.CarrierName,
),
)

Expand Down
18 changes: 9 additions & 9 deletions modules/connectors/seko/tests/seko/test_shipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -178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wIG4gCjAwMDAwMDA1NzUgMDAwMDAgbiAKdHJhaWxlcgo8PAovU2l6ZSA4Ci9Sb290IDMgMCBSCi9JbmZvIDIgMCBSCj4+CnN0YXJ0eHJlZgo1OTYKJSVFT0YK"
},
"docs": {"label": ANY},
"label_type": "PDF",
"meta": {
"CarrierId": 567,
"CarrierName": "MyChildData",
"ConsignmentId": 5473553,
"ConsignmentIds": [5473553],
"SiteId": 1153896,
"TrackingUrls": ["http://track.omniparcel.com/1153896-6994008906"],
"seko_carrier_id": 567,
"seko_site_id": 1153896,
"seko_carrier_type": 33,
"seko_carrier_name": "MyChildData",
"consignment_id": 5473553,
"consignment_ids": [5473553],
"tracking_urls": ["http://track.omniparcel.com/1153896-6994008906"],
"carrier_tracking_link": "http://track.omniparcel.com/1153896-6994008906",
"rate_provider": "MyChildData",
},
"shipment_identifier": 5473553,
"tracking_number": "6994008906",
Expand Down
16 changes: 6 additions & 10 deletions modules/documents/karrio/server/documents/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,12 @@ def generate(

buffer = io.BytesIO()
html = weasyprint.HTML(string=content, encoding="utf-8")

try:
html.write_pdf(
buffer,
stylesheets=STYLESHEETS,
font_config=FONT_CONFIG,
optimize_size=("fonts", "images"),
)
finally:
lib.failsafe(lambda: html.close())
html.write_pdf(
buffer,
stylesheets=STYLESHEETS,
font_config=FONT_CONFIG,
optimize_size=("fonts", "images"),
)

return buffer

Expand Down
4 changes: 2 additions & 2 deletions packages/types/rest/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.12rc6`. 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.12rc7`. 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.12rc6
* The version of the OpenAPI document: 2024.12rc7
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading
Loading