Skip to content

Commit eff48db

Browse files
authored
Merge pull request #113 from smswithoutborders/staging
Staging
2 parents 630418d + 222b2ec commit eff48db

4 files changed

Lines changed: 42 additions & 99 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \
1919
COPY requirements.txt .
2020

2121
RUN --mount=type=cache,sharing=locked,target=/root/.cache/pip \
22-
pip install --disable-pip-version-check --quiet --no-cache-dir -r requirements.txt
22+
pip install --disable-pip-version-check -r requirements.txt
2323

2424
COPY . .
2525

docs/specification.md

Lines changed: 36 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -250,76 +250,56 @@
250250
251251
> [!NOTE]
252252
>
253-
> This format extends V3 by adding support for image content. A content type indicator determines which content types are present.
253+
> This format extends V3 by adding support for image content.
254254
>
255255
> **All 2-byte length fields are encoded as unsigned little-endian.**
256256
257-
#### Content Type Indicator
258-
259-
The content type indicator is a single byte with the following values:
260-
261-
- **0**: Text-only content
262-
- **1**: Image-only content
263-
- **2**: Text and image content
264-
265257
1. **Email format**: Binary-encoded fields with the following structure:
266258

267-
- **1 byte**: Content type indicator
268-
- **1 byte**: Length of `from` field (if text content present).
269-
- **2 bytes**: Length of `to` field (if text content present).
270-
- **2 bytes**: Length of `cc` field (if text content present).
271-
- **2 bytes**: Length of `bcc` field (if text content present).
272-
- **1 byte**: Length of `subject` field (if text content present).
273-
- **2 bytes**: Length of `body` field (if text content present).
274-
- **2 bytes**: Length of `access_token` field (if text content present and optional).
275-
- **2 bytes**: Length of `refresh_token` field (if text content present and optional).
276-
- **2 bytes**: `Image Session ID` (if image content present).
277-
- **1 byte**: `Image Segment info` (if image content present).
278-
- **2 bytes**: Length of `Image` (if image content present).
279-
- **Variable**: Value of `from` field (if text content present).
280-
- **Variable**: Value of `to` field (if text content present).
281-
- **Variable**: Value of `cc` field (if text content present).
282-
- **Variable**: Value of `bcc` field (if text content present).
283-
- **Variable**: Value of `subject` field (if text content present).
284-
- **Variable**: Value of `body` field (if text content present).
285-
- **Variable**: Value of `access_token` field (if text content present and token provided).
286-
- **Variable**: Value of `refresh_token` field (if text content present and token provided).
287-
- **Variable**: Value of `Image` (if image content present).
259+
- **Variable**: Value of `image` field.
260+
- **1 byte**: Length of `from` field.
261+
- **2 bytes**: Length of `to` field.
262+
- **2 bytes**: Length of `cc` field.
263+
- **2 bytes**: Length of `bcc` field.
264+
- **1 byte**: Length of `subject` field.
265+
- **2 bytes**: Length of `body` field.
266+
- **2 bytes**: Length of `access_token` field (optional).
267+
- **2 bytes**: Length of `refresh_token` field (optional).
268+
- **Variable**: Value of `from` field.
269+
- **Variable**: Value of `to` field.
270+
- **Variable**: Value of `cc` field.
271+
- **Variable**: Value of `bcc` field.
272+
- **Variable**: Value of `subject` field.
273+
- **Variable**: Value of `body` field.
274+
- **Variable**: Value of `access_token` field (if present).
275+
- **Variable**: Value of `refresh_token` field (if present).
288276

289277
2. **Text format**: Binary-encoded fields with the following structure:
290278

291-
- **1 byte**: Content type indicator
292-
- **1 byte**: Length of `from` field (if text content present).
293-
- **2 bytes**: Length of `body` field (if text content present).
294-
- **2 bytes**: Length of `access_token` field (if text content present and optional).
295-
- **2 bytes**: Length of `refresh_token` field (if text content present and optional).
296-
- **2 bytes**: `Image Session ID` (if image content present).
297-
- **1 byte**: `Image Segment info` (if image content present).
298-
- **2 bytes**: Length of `Image` (if image content present).
299-
- **Variable**: Value of `from` field (if text content present).
300-
- **Variable**: Value of `body` field (if text content present).
301-
- **Variable**: Value of `access_token` field (if text content present and token provided).
302-
- **Variable**: Value of `refresh_token` field (if text content present and token provided).
303-
- **Variable**: Value of `Image` (if image content present).
279+
- **Variable**: Value of `image` field.
280+
- **1 byte**: Length of `from` field.
281+
- **2 bytes**: Length of `body` field.
282+
- **2 bytes**: Length of `access_token` field (optional).
283+
- **2 bytes**: Length of `refresh_token` field (optional).
284+
- **Variable**: Value of `from` field.
285+
- **Variable**: Value of `body` field.
286+
- **Variable**: Value of `access_token` field (if present).
287+
- **Variable**: Value of `refresh_token` field (if present).
304288

305289
3. **Message format**: Binary-encoded fields with the following structure:
306290

307-
- **1 byte**: Content type indicator
308-
- **1 byte**: Length of `from` field (if text content present).
309-
- **2 bytes**: Length of `to` field (if text content present).
310-
- **2 bytes**: Length of `body` field (if text content present).
311-
- **2 bytes**: `Image Session ID` (if image content present).
312-
- **1 byte**: `Image Segment info` (if image content present).
313-
- **2 bytes**: Length of `Image` (if image content present).
314-
- **Variable**: Value of `from` field (if text content present).
315-
- **Variable**: Value of `to` field (if text content present).
316-
- **Variable**: Value of `body` field (if text content present).
317-
- **Variable**: Value of `Image` (if image content present).
291+
- **Variable**: Value of `image` field.
292+
- **1 byte**: Length of `from` field.
293+
- **2 bytes**: Length of `to` field.
294+
- **2 bytes**: Length of `body` field.
295+
- **Variable**: Value of `from` field.
296+
- **Variable**: Value of `to` field.
297+
- **Variable**: Value of `body` field.
318298

319299
4. **Test format**: Binary-encoded fields with the following structure:
320300

321-
- **1 byte**: Length of `from` field (if text content present).
322-
- **Variable**: Value of `from` field (considered the test ID, if text content present).
301+
- **1 byte**: Length of `from` field.
302+
- **Variable**: Value of `from` field (considered the test ID).
323303

324304
## Supported Payload Versions
325305

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
fastapi[standard]==0.118.0
1+
fastapi[standard]==0.119.1
22
GitPython==3.1.45
33
grpc-interceptor==0.15.4
44
grpcio==1.75.1
55
grpcio-testing==1.75.1
66
grpcio-tools==1.75.1
77
peewee>=3.17.8
8-
phonenumbers==9.0.15
8+
phonenumbers==9.0.16
99
pymysql==1.1.2
1010
requests==2.32.5
11-
sentry-sdk[grpcio]==2.40.0
11+
sentry-sdk[grpcio]==2.42.1
1212
tqdm==4.67.1
13-
twilio==9.8.3
13+
twilio==9.8.4

resources/platforms.json

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1 @@
1-
[
2-
{
3-
"name": "gmail",
4-
"shortcode": "g",
5-
"service_type": "email",
6-
"protocol_type": "oauth2",
7-
"icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/gmail.svg",
8-
"icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/gmail.png",
9-
"support_url_scheme": false
10-
},
11-
{
12-
"name": "twitter",
13-
"shortcode": "t",
14-
"service_type": "text",
15-
"protocol_type": "oauth2",
16-
"icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/twitter.svg",
17-
"icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/twitter.png",
18-
"support_url_scheme": true
19-
},
20-
{
21-
"name": "telegram",
22-
"shortcode": "T",
23-
"service_type": "message",
24-
"protocol_type": "pnba",
25-
"icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/telegram.svg",
26-
"icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/main/resources/icons/telegram.png",
27-
"support_url_scheme": false
28-
},
29-
{
30-
"name": "reliability",
31-
"shortcode": "r",
32-
"service_type": "test",
33-
"protocol_type": "event",
34-
"icon_svg": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/staging/resources/icons/reliability.svg",
35-
"icon_png": "https://raw.githubusercontent.com/smswithoutborders/SMSWithoutBorders-Publisher/staging/resources/icons/reliability.png",
36-
"support_url_scheme": false
37-
}
38-
]
1+
[{"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}]

0 commit comments

Comments
 (0)