diff --git a/Dockerfile b/Dockerfile index 5780c83..2f6019c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \ COPY requirements.txt . RUN --mount=type=cache,sharing=locked,target=/root/.cache/pip \ - pip install --disable-pip-version-check --quiet --no-cache-dir -r requirements.txt + pip install --disable-pip-version-check -r requirements.txt COPY . . diff --git a/docs/specification.md b/docs/specification.md index 4e47f93..386fab4 100644 --- a/docs/specification.md +++ b/docs/specification.md @@ -250,76 +250,56 @@ > [!NOTE] > -> This format extends V3 by adding support for image content. A content type indicator determines which content types are present. +> This format extends V3 by adding support for image content. > > **All 2-byte length fields are encoded as unsigned little-endian.** -#### Content Type Indicator - -The content type indicator is a single byte with the following values: - -- **0**: Text-only content -- **1**: Image-only content -- **2**: Text and image content - 1. **Email format**: Binary-encoded fields with the following structure: - - **1 byte**: Content type indicator - - **1 byte**: Length of `from` field (if text content present). - - **2 bytes**: Length of `to` field (if text content present). - - **2 bytes**: Length of `cc` field (if text content present). - - **2 bytes**: Length of `bcc` field (if text content present). - - **1 byte**: Length of `subject` field (if text content present). - - **2 bytes**: Length of `body` field (if text content present). - - **2 bytes**: Length of `access_token` field (if text content present and optional). - - **2 bytes**: Length of `refresh_token` field (if text content present and optional). - - **2 bytes**: `Image Session ID` (if image content present). - - **1 byte**: `Image Segment info` (if image content present). - - **2 bytes**: Length of `Image` (if image content present). - - **Variable**: Value of `from` field (if text content present). - - **Variable**: Value of `to` field (if text content present). - - **Variable**: Value of `cc` field (if text content present). - - **Variable**: Value of `bcc` field (if text content present). - - **Variable**: Value of `subject` field (if text content present). - - **Variable**: Value of `body` field (if text content present). - - **Variable**: Value of `access_token` field (if text content present and token provided). - - **Variable**: Value of `refresh_token` field (if text content present and token provided). - - **Variable**: Value of `Image` (if image content present). + - **Variable**: Value of `image` field. + - **1 byte**: Length of `from` field. + - **2 bytes**: Length of `to` field. + - **2 bytes**: Length of `cc` field. + - **2 bytes**: Length of `bcc` field. + - **1 byte**: Length of `subject` field. + - **2 bytes**: Length of `body` field. + - **2 bytes**: Length of `access_token` field (optional). + - **2 bytes**: Length of `refresh_token` field (optional). + - **Variable**: Value of `from` field. + - **Variable**: Value of `to` field. + - **Variable**: Value of `cc` field. + - **Variable**: Value of `bcc` field. + - **Variable**: Value of `subject` field. + - **Variable**: Value of `body` field. + - **Variable**: Value of `access_token` field (if present). + - **Variable**: Value of `refresh_token` field (if present). 2. **Text format**: Binary-encoded fields with the following structure: - - **1 byte**: Content type indicator - - **1 byte**: Length of `from` field (if text content present). - - **2 bytes**: Length of `body` field (if text content present). - - **2 bytes**: Length of `access_token` field (if text content present and optional). - - **2 bytes**: Length of `refresh_token` field (if text content present and optional). - - **2 bytes**: `Image Session ID` (if image content present). - - **1 byte**: `Image Segment info` (if image content present). - - **2 bytes**: Length of `Image` (if image content present). - - **Variable**: Value of `from` field (if text content present). - - **Variable**: Value of `body` field (if text content present). - - **Variable**: Value of `access_token` field (if text content present and token provided). - - **Variable**: Value of `refresh_token` field (if text content present and token provided). - - **Variable**: Value of `Image` (if image content present). + - **Variable**: Value of `image` field. + - **1 byte**: Length of `from` field. + - **2 bytes**: Length of `body` field. + - **2 bytes**: Length of `access_token` field (optional). + - **2 bytes**: Length of `refresh_token` field (optional). + - **Variable**: Value of `from` field. + - **Variable**: Value of `body` field. + - **Variable**: Value of `access_token` field (if present). + - **Variable**: Value of `refresh_token` field (if present). 3. **Message format**: Binary-encoded fields with the following structure: - - **1 byte**: Content type indicator - - **1 byte**: Length of `from` field (if text content present). - - **2 bytes**: Length of `to` field (if text content present). - - **2 bytes**: Length of `body` field (if text content present). - - **2 bytes**: `Image Session ID` (if image content present). - - **1 byte**: `Image Segment info` (if image content present). - - **2 bytes**: Length of `Image` (if image content present). - - **Variable**: Value of `from` field (if text content present). - - **Variable**: Value of `to` field (if text content present). - - **Variable**: Value of `body` field (if text content present). - - **Variable**: Value of `Image` (if image content present). + - **Variable**: Value of `image` field. + - **1 byte**: Length of `from` field. + - **2 bytes**: Length of `to` field. + - **2 bytes**: Length of `body` field. + - **Variable**: Value of `from` field. + - **Variable**: Value of `to` field. + - **Variable**: Value of `body` field. 4. **Test format**: Binary-encoded fields with the following structure: - - **1 byte**: Length of `from` field (if text content present). - - **Variable**: Value of `from` field (considered the test ID, if text content present). + - **1 byte**: Length of `from` field. + - **Variable**: Value of `from` field (considered the test ID). ## Supported Payload Versions diff --git a/requirements.txt b/requirements.txt index db7198a..a354d41 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,13 @@ -fastapi[standard]==0.118.0 +fastapi[standard]==0.119.1 GitPython==3.1.45 grpc-interceptor==0.15.4 grpcio==1.75.1 grpcio-testing==1.75.1 grpcio-tools==1.75.1 peewee>=3.17.8 -phonenumbers==9.0.15 +phonenumbers==9.0.16 pymysql==1.1.2 requests==2.32.5 -sentry-sdk[grpcio]==2.40.0 +sentry-sdk[grpcio]==2.42.1 tqdm==4.67.1 -twilio==9.8.3 +twilio==9.8.4 diff --git a/resources/platforms.json b/resources/platforms.json index b519c2d..4735e15 100644 --- a/resources/platforms.json +++ b/resources/platforms.json @@ -1,38 +1 @@ -[ - { - "name": "gmail", - "shortcode": "g", - "service_type": "email", - "protocol_type": "oauth2", - "icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/gmail.svg", - "icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/gmail.png", - "support_url_scheme": false - }, - { - "name": "twitter", - "shortcode": "t", - "service_type": "text", - "protocol_type": "oauth2", - "icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/twitter.svg", - "icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/twitter.png", - "support_url_scheme": true - }, - { - "name": "telegram", - "shortcode": "T", - "service_type": "message", - "protocol_type": "pnba", - "icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/telegram.svg", - "icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/telegram.png", - "support_url_scheme": false - }, - { - "name": "reliability", - "shortcode": "r", - "service_type": "test", - "protocol_type": "event", - "icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/staging/resources/icons/reliability.svg", - "icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/staging/resources/icons/reliability.png", - "support_url_scheme": false - } -] +[{"name":"gmail","shortcode":"g","protocol_type":"oauth2","service_type":"email","icon_svg":"https://raw.githubusercontent.com/smswithoutborders/gmail-oauth2-adapter/main/icons/gmail.svg","icon_png":"https://raw.githubusercontent.com/smswithoutborders/gmail-oauth2-adapter/main/icons/gmail.png","support_url_scheme":false},{"name":"mastodon","shortcode":"m","protocol_type":"oauth2","service_type":"text","icon_svg":"https://raw.githubusercontent.com/smswithoutborders/mastodon-oauth2-adapter/main/icons/mastodon.svg","icon_png":"https://raw.githubusercontent.com/smswithoutborders/mastodon-oauth2-adapter/main/icons/mastodon.png","support_url_scheme":false},{"name":"telegram","shortcode":"T","protocol_type":"pnba","service_type":"message","icon_svg":"https://raw.githubusercontent.com/smswithoutborders/telegram-pnba-adapter/main/icons/telegram.svg","icon_png":"https://raw.githubusercontent.com/smswithoutborders/telegram-pnba-adapter/main/icons/telegram.png","support_url_scheme":false},{"name":"bluesky","shortcode":"b","protocol_type":"oauth2","service_type":"text","icon_svg":"https://raw.githubusercontent.com/smswithoutborders/bluesky-oauth2-adapter/main/icons/bluesky.svg","icon_png":"https://raw.githubusercontent.com/smswithoutborders/bluesky-oauth2-adapter/main/icons/bluesky.png","support_url_scheme":false},{"name":"reliability","shortcode":"r","protocol_type":"event","service_type":"test","icon_svg":"https://raw.githubusercontent.com/smswithoutborders/reliability-event-adapter/main/icons/reliability.svg","icon_png":"https://raw.githubusercontent.com/smswithoutborders/reliability-event-adapter/main/icons/reliability.png","support_url_scheme":false},{"name":"twitter","shortcode":"t","protocol_type":"oauth2","service_type":"text","icon_svg":"https://raw.githubusercontent.com/smswithoutborders/twitter-oauth2-adapter/main/icons/twitter.svg","icon_png":"https://raw.githubusercontent.com/smswithoutborders/twitter-oauth2-adapter/main/icons/twitter.png","support_url_scheme":true}] \ No newline at end of file