From a8af9bef298bc09221f4209d743be8d62ddf84c4 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 18 May 2015 16:13:41 +0100 Subject: [PATCH] Add example events. These can be used for assertions as well as drop ins for the spec. --- event-schemas/README.md | 2 +- event-schemas/examples/m.room.message_m.emote | 12 ++++++++++++ event-schemas/examples/m.room.message_m.image | 19 +++++++++++++++++++ .../examples/m.room.message_m.notice | 12 ++++++++++++ event-schemas/examples/m.room.message_m.text | 12 ++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 event-schemas/examples/m.room.message_m.emote create mode 100644 event-schemas/examples/m.room.message_m.image create mode 100644 event-schemas/examples/m.room.message_m.notice create mode 100644 event-schemas/examples/m.room.message_m.text diff --git a/event-schemas/README.md b/event-schemas/README.md index 05ae743a..81d86a9a 100644 --- a/event-schemas/README.md +++ b/event-schemas/README.md @@ -7,7 +7,7 @@ resolved correctly. For basic CLI testing, we recommend and have verified they work with the Node.js package [z-schema](https://github.com/zaggino/z-schema): ``` $ npm install -g z-schema - $ z-schema m.room.message /path/to/json/file.json + $ z-schema m.room.message examples/m.room.message_m.text schema validation passed json #1 validation passed ``` diff --git a/event-schemas/examples/m.room.message_m.emote b/event-schemas/examples/m.room.message_m.emote new file mode 100644 index 00000000..bd984831 --- /dev/null +++ b/event-schemas/examples/m.room.message_m.emote @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "body": "thinks this is an example emote", + "msgtype": "m.emote" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/m.room.message_m.image b/event-schemas/examples/m.room.message_m.image new file mode 100644 index 00000000..ba405a1a --- /dev/null +++ b/event-schemas/examples/m.room.message_m.image @@ -0,0 +1,19 @@ +{ + "age": 242352, + "content": { + "body": "filename.jpg", + "info": { + "h": 398, + "w": 394, + "mimetype": "image/jpeg", + "size": 31037 + }, + "url": "mxc://localhost/JWEIFJgwEIhweiWJE", + "msgtype": "m.image" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/m.room.message_m.notice b/event-schemas/examples/m.room.message_m.notice new file mode 100644 index 00000000..2e5fff97 --- /dev/null +++ b/event-schemas/examples/m.room.message_m.notice @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "body": "This is an example notice", + "msgtype": "m.notice" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +} diff --git a/event-schemas/examples/m.room.message_m.text b/event-schemas/examples/m.room.message_m.text new file mode 100644 index 00000000..d877ee64 --- /dev/null +++ b/event-schemas/examples/m.room.message_m.text @@ -0,0 +1,12 @@ +{ + "age": 242352, + "content": { + "body": "This is an example text message", + "msgtype": "m.text" + }, + "origin_server_ts": 1431961217939, + "event_id": "$WLGTSEFSEF:localhost", + "type": "m.room.message", + "room_id": "!Cuyf34gef24t:localhost", + "user_id": "@example:localhost" +}