Skip to content

Commit

Permalink
Chore/Add properties of Message (#193)
Browse files Browse the repository at this point in the history
* chore: add isOwn and wasReadAt to Message

* feat: formate 'content' in text
  • Loading branch information
Milena-Czierlinski committed May 8, 2024
1 parent ba3028e commit 37cb3ab
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions _includes/scenarios/integrate/data-model-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Note that RelationshipChangeRequest and RelationshipChangeResponse have nothing

## Message

A Message is a piece of data that can be sent to one or more recipients. The sender is completely free in what the content of the Message looks like. Though in order to enable a normalized communication, enmeshed defines some content structures for Messages, and in the future there will be more of those. Consider that the enmeshed App only supports those normalized Message contents. Currently there are:
A Message is a piece of data that can be sent to one or more recipients. The sender is completely free in what the content of the Message looks like. Though in order to enable a normalized communication, enmeshed defines some `content` structures for Messages, and in the future there will be more of those. Consider that the enmeshed App only supports Messages with such a normalized `content`. Currently there are:

- [`Mail`](#mail)
- [`Request`](#request)
Expand All @@ -112,17 +112,19 @@ A Message is a piece of data that can be sent to one or more recipients. The sen

You can read more details about each of these in the corresponding sections of the "Content Types" chapter.

But if you are communicating with another Connector, feel free to settle on any content structure that fits your needs.

| Name | Type | Description | Remarks |
| --------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| id | `string` | {% include descr_id class="Message" prefix="MSG" %} | |
| content | `unknown` | The content of the Message. You can add whatever you want here. However, if it is intended for a User of the enmeshed App, use either `Mail`, `Request`, `Response` or `Notification`. Otherwise feel free to insert whatever you want or need. | will be encrypted before sent to the Backbone |
| createdBy | `string` | {% include descr_createdBy class="Message" %} | |
| createdByDevice | `string` | {% include descr_createdByDevice class="Message" %} | |
| recipients | [`Recipient`](#recipient)`[]` | An array of recipients of this Message. | |
| createdAt | `string` | {% include descr_createdAt class="Message" %} | |
| attachments | `string[]` | An array of [File](#file) IDs you want to attach to your Message. You receive the File ID after you uploaded a file to the Backbone. By attaching a File to a Message, you share the secret key used to encrypt/decrypt the File, which cannot be undone. | |
But if you are communicating with another Connector, feel free to settle on any `content` structure that fits your needs.

| Name | Type | Description | Remarks |
| --------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| id | `string` | {% include descr_id class="Message" prefix="MSG" %} | |
| content | `unknown` | The content of the Message. You can add whatever you want here. However, if it is intended for a User of the enmeshed App, use either `Mail`, `Request`, `Response` or `Notification`. Otherwise feel free to insert whatever you want or need. | will be encrypted before sent to the Backbone |
| createdBy | `string` | {% include descr_createdBy class="Message" %} | |
| createdByDevice | `string` | {% include descr_createdByDevice class="Message" %} | |
| recipients | [`Recipient`](#recipient)`[]` | An array of recipients of this Message. | |
| createdAt | `string` | {% include descr_createdAt class="Message" %} | |
| attachments | `string[]` | An array of [File](#file) IDs you want to attach to your Message. You receive the File ID after you uploaded a file to the Backbone. By attaching a File to a Message, you share the secret key used to encrypt/decrypt the File, which cannot be undone. | |
| isOwn | `boolean` | Indicates whether you are the sender (`true`) or recipient (`false`) of the Message. | |
| wasReadAt | `string` \| `undefined` | A timestamp indicating when the Message was firstly read. If a Message is marked as unread, this will be `undefined`. If a Message is read again, after having marked it as unread, the timestamp is updated. However, if a Message marked as read is read again, it won't be updated. | |

### Recipient

Expand Down

0 comments on commit 37cb3ab

Please sign in to comment.