Skip to content

Commit 93021f9

Browse files
committed
feat(specification): simplify Content Format V4 by removing content type indicator details
1 parent 80e40bc commit 93021f9

1 file changed

Lines changed: 36 additions & 56 deletions

File tree

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

0 commit comments

Comments
 (0)