
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
forever-chat-format
Advanced tools
Validators for a chat exporter to ensure data conforms to forever chat format standards
Because in the world where our communication is siloed into Google Hangouts, Facebook, iMessage, WhatsApp, etc etc it's getting hard to hold onto conversations for archival purposes. First thing we need is a universal format that we can export those proprietary chats into that's easy to understand, and that can be relied upon.
Output should be an array of hashes, and each object in the array is a JSON object defined as follows:
| Name | Type | Description |
|---|---|---|
| sha | string | sha1 of [sender, receiver, date, text, service] |
| sender | string | The handle of the person sending the message |
| receiver | string | The handle of the person receiving the message |
| is_from_me | boolean | true if you sent the message |
| send_error | boolean | true if the message didn't send |
| date | ISO-8601 datetime | date message was sent/received by sender |
| service | string | Service message was sent using. All lowercase, dasherized. 'imessage', 'google-hangouts', 'facebook-messenger', 'sms' |
| date_read | ISO-8601 datetime | (optional) date message was sent/read by receiver |
| date_delivered | ISO-8601 datetime | (optional) date message was delivered by receiver |
| participants | array | (see definition below) An array of strings of handles involved in the conversations. Used for grouping. For a two person conversation, this has two entries in it. Sender and receiver are always here. |
| message_text | string | text representation of the message |
| message_segments | array | (see definition below) ordered segments of content as it appears in the message |
| attachments | array | (see definition below) array of attachments |
| associated_sha | string | sha of message this message is in response to. Generally used for reactions |
| _debug | object | (optional) debug information to help trace back to the source of the data |
| Name | Type | Possible Values | Description |
|---|---|---|---|
| type | string | text, link, file | base segment type |
| file_type | string | null, or a mime_type | only valid when type == file |
| path | string | url or file path | |
| text | string | the rendered name of the link, or the text content for the text, or optionally |
{"type": "text", "text": "Why hello there"}
{"type": "link", "text": "Whoa, unreal", "path": "http://latlmes.com/technology/why-we-need-a-new-chat-format-1"}
{"type": "file", "file_type": "image/png", "path": "/path/to/image.png"}
{"type": "reaction", "reaction_type": "laughed"}
Array of attachments in the order they were received. Each attachment has the following properties. This information should also be made available in message_segments.
| Name | Type |
|---|---|
| path | string |
| type | string |
The included tests check whether some json is valid forever chat format.
var foreverJson = importer("test.json"); // done by an exporter
var {validate, runTests} = require('forever-chat-format-tests');
runTests(foreverJson); // runs mocha tests on data
The last step of your exporter should be to pass your exported data to the prepare function. It will check that the data conforms to the forever-chat-format spec and then return a hash with two keys: messages, and validations. Messages is all the data your exporter returned, and validations are what you see below:
"validations": {
"version": 1.2 // forever chat version
"checkedCount": 100 // number of records checked
"errorCount": 0 // number of records with errors
"recordsWithErrors":
"ruleResults": { /* each rule keyed by name with errorCount and "erroredRecords" */
"unique-sha": {
"description": "Each record should have a unique sha",
"errorCount": 0,
"erroredRecords": []
}
...
}
}
var foreverJson = importer("test.json"); // done by an exporter
var {validate, runTests} = require('forever-chat-format-tests');
runTests(foreverJson);
FAQs
Validators for a chat exporter to ensure data conforms to forever chat format standards
The npm package forever-chat-format receives a total of 3 weekly downloads. As such, forever-chat-format popularity was classified as not popular.
We found that forever-chat-format demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.