2020-08-01 03:43:15 +02:00
|
|
|
"use strict";
|
|
|
|
|
2020-08-18 15:29:16 +02:00
|
|
|
// These events are not guaranteed to be perfectly
|
|
|
|
// representative of what the server sends. We
|
2021-01-20 19:39:32 +01:00
|
|
|
// have a tool called check-schemas that tries
|
2020-08-18 15:29:16 +02:00
|
|
|
// to validate this data against server side schemas,
|
|
|
|
// but there are certain edge cases that the tool now
|
|
|
|
// skips. And even when the data matches the schema,
|
|
|
|
// it may not be completely representative.
|
2020-06-12 20:26:04 +02:00
|
|
|
|
2020-08-18 15:32:33 +02:00
|
|
|
const test_user = {
|
2020-07-15 01:29:15 +02:00
|
|
|
email: "test@example.com",
|
2020-06-12 20:26:04 +02:00
|
|
|
user_id: 101,
|
2020-07-15 01:29:15 +02:00
|
|
|
full_name: "Test User",
|
2020-06-12 20:26:04 +02:00
|
|
|
};
|
2020-08-18 15:32:33 +02:00
|
|
|
exports.test_user = test_user;
|
2020-06-12 20:26:04 +02:00
|
|
|
|
|
|
|
exports.test_message = {
|
2020-08-18 15:32:33 +02:00
|
|
|
sender_id: test_user.user_id,
|
2020-06-12 20:26:04 +02:00
|
|
|
id: 99,
|
|
|
|
};
|
|
|
|
|
2020-07-25 22:58:18 +02:00
|
|
|
const typing_person1 = {
|
|
|
|
user_id: 1,
|
|
|
|
email: "user1@example.com",
|
|
|
|
};
|
|
|
|
|
|
|
|
const typing_person2 = {
|
|
|
|
user_id: 2,
|
|
|
|
email: "user2@example.com",
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.typing_person1 = typing_person1;
|
|
|
|
exports.typing_person2 = typing_person2;
|
|
|
|
|
2020-08-06 13:51:44 +02:00
|
|
|
const fake_then = 1596710000;
|
2020-08-06 13:45:36 +02:00
|
|
|
const fake_now = 1596713966;
|
|
|
|
|
2020-08-01 17:02:51 +02:00
|
|
|
exports.test_streams = {
|
2020-07-25 22:33:03 +02:00
|
|
|
devel: {
|
|
|
|
name: "devel",
|
|
|
|
description: ":devel fun:",
|
|
|
|
rendered_description: "<b>devel fun</b>",
|
|
|
|
invite_only: false,
|
|
|
|
stream_id: 101,
|
2020-08-06 13:51:44 +02:00
|
|
|
date_created: fake_now,
|
2020-07-25 22:33:03 +02:00
|
|
|
first_message_id: 1,
|
|
|
|
history_public_to_subscribers: false,
|
|
|
|
is_announcement_only: false,
|
|
|
|
is_web_public: false,
|
|
|
|
message_retention_days: null,
|
|
|
|
stream_post_policy: 1,
|
|
|
|
},
|
|
|
|
test: {
|
|
|
|
name: "test",
|
|
|
|
description: "test desc",
|
|
|
|
rendered_description: "test desc",
|
|
|
|
invite_only: true,
|
|
|
|
stream_id: 102,
|
2020-08-06 13:51:44 +02:00
|
|
|
date_created: fake_then,
|
2020-07-25 22:33:03 +02:00
|
|
|
first_message_id: 1,
|
|
|
|
history_public_to_subscribers: false,
|
|
|
|
is_web_public: false,
|
|
|
|
is_announcement_only: false,
|
|
|
|
message_retention_days: null,
|
|
|
|
stream_post_policy: 1,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2020-08-01 17:02:51 +02:00
|
|
|
const streams = exports.test_streams;
|
|
|
|
|
2020-08-05 19:04:27 +02:00
|
|
|
exports.test_realm_emojis = {
|
|
|
|
101: {
|
|
|
|
id: "101",
|
|
|
|
name: "spain",
|
|
|
|
source_url: "/some/path/to/spain.png",
|
|
|
|
deactivated: false,
|
2020-08-18 15:36:30 +02:00
|
|
|
author_id: test_user.user_id,
|
2020-08-05 19:04:27 +02:00
|
|
|
},
|
|
|
|
102: {
|
|
|
|
id: "102",
|
|
|
|
name: "green_tick",
|
|
|
|
author_id: 222,
|
|
|
|
deactivated: false,
|
|
|
|
source_url: "/some/path/to/emoji",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
exports.fixtures = {
|
|
|
|
alert_words: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "alert_words",
|
|
|
|
alert_words: ["fire", "lunch"],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-08-05 19:04:42 +02:00
|
|
|
attachment__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "attachment",
|
2020-08-05 19:04:42 +02:00
|
|
|
op: "add",
|
2020-08-06 13:45:36 +02:00
|
|
|
attachment: {
|
|
|
|
id: 99,
|
|
|
|
name: "foo.png",
|
|
|
|
size: 4096,
|
|
|
|
path_id: "path_id",
|
|
|
|
create_time: fake_now,
|
|
|
|
messages: [
|
|
|
|
{
|
|
|
|
id: 1000,
|
|
|
|
date_sent: fake_now,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
upload_space_used: 90000,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-08-05 19:04:42 +02:00
|
|
|
custom_profile_fields__update: {
|
2020-07-29 14:05:55 +02:00
|
|
|
type: "custom_profile_fields",
|
|
|
|
op: "update",
|
|
|
|
fields: [
|
|
|
|
{id: 1, name: "teams", type: 1},
|
|
|
|
{id: 2, name: "hobbies", type: 1},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
default_streams: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "default_streams",
|
2020-07-25 22:33:03 +02:00
|
|
|
default_streams: [streams.devel, streams.test],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
delete_message: {
|
|
|
|
type: "delete_message",
|
|
|
|
message_ids: [1337],
|
|
|
|
message_type: "stream",
|
|
|
|
stream_id: 99,
|
|
|
|
topic: "topic1",
|
|
|
|
},
|
|
|
|
|
2020-08-16 17:17:46 +02:00
|
|
|
has_zoom_token: {
|
|
|
|
type: "has_zoom_token",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
hotspots: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "hotspots",
|
2020-08-05 20:03:48 +02:00
|
|
|
hotspots: [
|
|
|
|
{
|
|
|
|
name: "topics",
|
|
|
|
title: "About topics",
|
|
|
|
description: "Topics are good.",
|
|
|
|
delay: 1.5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "compose",
|
|
|
|
title: "Compose box",
|
|
|
|
description: "This is where you compose messages.",
|
|
|
|
delay: 3.14159,
|
|
|
|
},
|
|
|
|
],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
invites_changed: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "invites_changed",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
muted_topics: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "muted_topics",
|
2020-07-15 00:34:28 +02:00
|
|
|
muted_topics: [
|
2020-08-06 20:45:39 +02:00
|
|
|
["devel", "js", fake_then],
|
|
|
|
["lunch", "burritos", fake_now],
|
2020-07-15 00:34:28 +02:00
|
|
|
],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
presence: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "presence",
|
|
|
|
email: "alice@example.com",
|
2020-06-12 20:26:04 +02:00
|
|
|
user_id: 42,
|
|
|
|
presence: {
|
2020-08-13 20:21:54 +02:00
|
|
|
electron: {
|
|
|
|
status: "active",
|
|
|
|
timestamp: fake_now,
|
|
|
|
client: "electron",
|
|
|
|
pushable: false,
|
|
|
|
},
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
2020-08-06 13:51:44 +02:00
|
|
|
server_timestamp: fake_now,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
reaction__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "reaction",
|
|
|
|
op: "add",
|
2020-06-12 20:26:04 +02:00
|
|
|
message_id: 128,
|
2020-08-17 15:28:17 +02:00
|
|
|
reaction_type: "unicode_emoji",
|
|
|
|
emoji_name: "airplane",
|
|
|
|
emoji_code: "2708",
|
2020-08-18 15:32:33 +02:00
|
|
|
user_id: test_user.user_id,
|
2020-06-12 20:26:04 +02:00
|
|
|
user: {
|
2020-08-18 15:32:33 +02:00
|
|
|
email: test_user.email,
|
|
|
|
full_name: test_user.full_name,
|
|
|
|
user_id: test_user.user_id,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
reaction__remove: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "reaction",
|
|
|
|
op: "remove",
|
2020-06-12 20:26:04 +02:00
|
|
|
message_id: 256,
|
2020-08-17 15:28:17 +02:00
|
|
|
reaction_type: "unicode_emoji",
|
|
|
|
emoji_name: "8ball",
|
|
|
|
emoji_code: "1f3b1",
|
2020-08-18 15:32:33 +02:00
|
|
|
user_id: test_user.user_id,
|
2020-06-12 20:26:04 +02:00
|
|
|
user: {
|
2020-08-18 15:32:33 +02:00
|
|
|
email: test_user.email,
|
|
|
|
full_name: test_user.full_name,
|
|
|
|
user_id: test_user.user_id,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
realm__deactivated: {
|
|
|
|
type: "realm",
|
|
|
|
op: "deactivated",
|
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__bot_creation_policy: {
|
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "bot_creation_policy",
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
realm__update__create_stream_policy: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "create_stream_policy",
|
2020-06-12 20:26:04 +02:00
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__default_code_block_language: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "default_code_block_language",
|
|
|
|
value: "javascript",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__default_twenty_four_hour_time: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "default_twenty_four_hour_time",
|
2020-06-12 20:26:04 +02:00
|
|
|
value: false,
|
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__disallow_disposable_email_addresses: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "disallow_disposable_email_addresses",
|
|
|
|
value: false,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__email_addresses_visibility: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "email_address_visibility",
|
|
|
|
value: 3,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__emails_restricted_to_domains: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "emails_restricted_to_domains",
|
|
|
|
value: false,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__invite_required: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "invite_required",
|
|
|
|
value: false,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__invite_to_stream_policy: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "invite_to_stream_policy",
|
|
|
|
value: 2,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__name: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2020-07-29 13:19:47 +02:00
|
|
|
property: "name",
|
|
|
|
value: "new_realm_name",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__notifications_stream_id: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "notifications_stream_id",
|
2020-06-12 20:26:04 +02:00
|
|
|
value: 42,
|
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__signup_notifications_stream_id: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "signup_notifications_stream_id",
|
2020-06-12 20:26:04 +02:00
|
|
|
value: 41,
|
|
|
|
},
|
|
|
|
|
|
|
|
realm__update_dict__default: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update_dict",
|
|
|
|
property: "default",
|
2020-06-12 20:26:04 +02:00
|
|
|
data: {
|
|
|
|
allow_message_editing: true,
|
|
|
|
message_content_edit_limit_seconds: 5,
|
|
|
|
authentication_methods: {
|
|
|
|
Google: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm__update_dict__icon: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update_dict",
|
|
|
|
property: "icon",
|
2020-06-12 20:26:04 +02:00
|
|
|
data: {
|
2020-07-15 01:29:15 +02:00
|
|
|
icon_url: "icon.png",
|
|
|
|
icon_source: "U",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm__update_dict__logo: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update_dict",
|
|
|
|
property: "logo",
|
2020-06-12 20:26:04 +02:00
|
|
|
data: {
|
2020-07-15 01:29:15 +02:00
|
|
|
logo_url: "logo.png",
|
|
|
|
logo_source: "U",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm__update_dict__night_logo: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update_dict",
|
|
|
|
property: "night_logo",
|
2020-06-12 20:26:04 +02:00
|
|
|
data: {
|
2020-07-15 01:29:15 +02:00
|
|
|
night_logo_url: "night_logo.png",
|
|
|
|
night_logo_source: "U",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm_bot__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_bot",
|
|
|
|
op: "add",
|
2020-06-12 20:26:04 +02:00
|
|
|
bot: {
|
2020-07-15 01:29:15 +02:00
|
|
|
email: "the-bot@example.com",
|
2020-07-25 22:09:04 +02:00
|
|
|
user_id: 42,
|
|
|
|
avatar_url: "/some/path/to/avatar",
|
|
|
|
api_key: "SOME_KEY",
|
2020-07-15 01:29:15 +02:00
|
|
|
full_name: "The Bot",
|
2020-07-25 22:09:04 +02:00
|
|
|
bot_type: 1,
|
|
|
|
default_all_public_streams: true,
|
|
|
|
default_events_register_stream: "whatever",
|
|
|
|
default_sending_stream: "whatever",
|
|
|
|
is_active: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
owner_id: test_user.user_id,
|
2020-07-25 22:09:04 +02:00
|
|
|
services: [],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
realm_bot__delete: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_bot",
|
2020-07-29 14:05:55 +02:00
|
|
|
op: "delete",
|
2020-06-12 20:26:04 +02:00
|
|
|
bot: {
|
2020-07-25 22:09:04 +02:00
|
|
|
user_id: 42,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
realm_bot__remove: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_bot",
|
2020-07-29 14:05:55 +02:00
|
|
|
op: "remove",
|
2020-06-12 20:26:04 +02:00
|
|
|
bot: {
|
2020-07-25 22:09:04 +02:00
|
|
|
user_id: 42,
|
2020-07-29 14:05:55 +02:00
|
|
|
full_name: "The Bot",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm_bot__update: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_bot",
|
|
|
|
op: "update",
|
2020-06-12 20:26:04 +02:00
|
|
|
bot: {
|
|
|
|
user_id: 4321,
|
2020-07-15 01:29:15 +02:00
|
|
|
full_name: "The Bot Has A New Name",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm_domains__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_domains",
|
|
|
|
op: "add",
|
2020-06-12 20:26:04 +02:00
|
|
|
realm_domain: {
|
2020-07-15 01:29:15 +02:00
|
|
|
domain: "ramen",
|
2020-06-12 20:26:04 +02:00
|
|
|
allow_subdomains: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm_domains__change: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_domains",
|
|
|
|
op: "change",
|
2020-06-12 20:26:04 +02:00
|
|
|
realm_domain: {
|
2020-07-15 01:29:15 +02:00
|
|
|
domain: "ramen",
|
2020-06-12 20:26:04 +02:00
|
|
|
allow_subdomains: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm_domains__remove: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_domains",
|
|
|
|
op: "remove",
|
|
|
|
domain: "ramen",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-08-05 19:04:27 +02:00
|
|
|
realm_emoji__update: {
|
2020-07-29 14:05:55 +02:00
|
|
|
type: "realm_emoji",
|
2020-08-05 19:04:27 +02:00
|
|
|
op: "update",
|
|
|
|
realm_emoji: exports.test_realm_emojis,
|
2020-07-29 14:05:55 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
realm_export: {
|
|
|
|
type: "realm_export",
|
2020-08-06 00:14:21 +02:00
|
|
|
exports: [
|
|
|
|
{
|
|
|
|
id: 55,
|
|
|
|
export_time: fake_now,
|
2020-08-18 15:32:33 +02:00
|
|
|
acting_user_id: test_user.user_id,
|
2020-08-06 00:14:21 +02:00
|
|
|
export_url: "/some/path/to/export",
|
|
|
|
deleted_timestamp: null,
|
|
|
|
failed_timestamp: null,
|
|
|
|
pending: true,
|
|
|
|
},
|
|
|
|
],
|
2020-07-29 14:05:55 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
realm_filters: {
|
|
|
|
type: "realm_filters",
|
2020-08-08 15:15:01 +02:00
|
|
|
realm_filters: [["#[123]", "ticket %(id)s", 55]],
|
2020-07-29 14:05:55 +02:00
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
realm_user__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_user",
|
|
|
|
op: "add",
|
2020-08-14 02:45:53 +02:00
|
|
|
person: {
|
2020-08-18 15:32:33 +02:00
|
|
|
...test_user,
|
2020-08-14 02:45:53 +02:00
|
|
|
avatar_url: "/some/path/to/avatar",
|
|
|
|
avatar_version: 1,
|
|
|
|
is_admin: false,
|
|
|
|
is_active: true,
|
|
|
|
is_owner: false,
|
|
|
|
is_bot: false,
|
|
|
|
is_guest: false,
|
|
|
|
profile_data: {},
|
2020-10-27 01:41:00 +01:00
|
|
|
timezone: "America/New_York",
|
2020-08-14 02:45:53 +02:00
|
|
|
date_joined: "2020-01-01",
|
|
|
|
},
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
realm_user__remove: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_user",
|
|
|
|
op: "remove",
|
2020-06-12 20:26:04 +02:00
|
|
|
person: {
|
2020-08-18 18:40:49 +02:00
|
|
|
full_name: test_user.full_name,
|
2020-08-18 15:32:33 +02:00
|
|
|
user_id: test_user.user_id,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
realm_user__update: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm_user",
|
|
|
|
op: "update",
|
2020-06-12 20:26:04 +02:00
|
|
|
person: {
|
2020-08-18 15:32:33 +02:00
|
|
|
user_id: test_user.user_id,
|
2020-07-25 22:15:45 +02:00
|
|
|
full_name: "Bob NewName",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
restart: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "restart",
|
2020-06-12 20:26:04 +02:00
|
|
|
immediate: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
stream__create: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "stream",
|
|
|
|
op: "create",
|
2020-07-25 22:33:03 +02:00
|
|
|
streams: [streams.devel, streams.test],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
stream__delete: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "stream",
|
|
|
|
op: "delete",
|
2020-08-01 17:02:51 +02:00
|
|
|
streams: [streams.devel, streams.test],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
stream__update: {
|
|
|
|
type: "stream",
|
|
|
|
op: "update",
|
|
|
|
name: "devel",
|
|
|
|
stream_id: 99,
|
|
|
|
property: "color",
|
|
|
|
value: "blue",
|
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
submessage: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "submessage",
|
2020-06-12 20:26:04 +02:00
|
|
|
submessage_id: 99,
|
|
|
|
sender_id: 42,
|
2020-07-15 01:29:15 +02:00
|
|
|
msg_type: "stream",
|
2020-06-12 20:26:04 +02:00
|
|
|
message_id: 56,
|
2020-07-15 01:29:15 +02:00
|
|
|
content: "test",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
subscription__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "subscription",
|
|
|
|
op: "add",
|
2020-06-12 20:26:04 +02:00
|
|
|
subscriptions: [
|
|
|
|
{
|
2020-07-25 22:33:03 +02:00
|
|
|
...streams.devel,
|
|
|
|
audible_notifications: true,
|
|
|
|
color: "blue",
|
|
|
|
desktop_notifications: false,
|
|
|
|
email_address: "whatever",
|
|
|
|
email_notifications: false,
|
|
|
|
in_home_view: false,
|
|
|
|
is_muted: true,
|
|
|
|
pin_to_top: false,
|
|
|
|
push_notifications: false,
|
|
|
|
stream_weekly_traffic: 40,
|
|
|
|
wildcard_mentions_notify: false,
|
2020-07-15 16:02:35 +02:00
|
|
|
role: 20,
|
2020-07-25 22:33:03 +02:00
|
|
|
subscribers: [5, 8, 13, 21],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
subscription__peer_add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "subscription",
|
|
|
|
op: "peer_add",
|
2020-10-22 14:14:02 +02:00
|
|
|
user_ids: [test_user.user_id],
|
|
|
|
stream_ids: [streams.devel.stream_id],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
subscription__peer_remove: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "subscription",
|
|
|
|
op: "peer_remove",
|
2020-10-22 14:14:02 +02:00
|
|
|
user_ids: [test_user.user_id],
|
|
|
|
stream_ids: [streams.devel.stream_id],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
subscription__remove: {
|
|
|
|
type: "subscription",
|
|
|
|
op: "remove",
|
|
|
|
subscriptions: [
|
|
|
|
{
|
|
|
|
name: "devel",
|
|
|
|
stream_id: 42,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
subscription__update: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "subscription",
|
|
|
|
op: "update",
|
2020-08-18 15:32:33 +02:00
|
|
|
email: test_user.email,
|
2020-08-17 14:39:33 +02:00
|
|
|
name: streams.devel.name,
|
|
|
|
stream_id: streams.devel.stream_id,
|
|
|
|
property: "pin_to_top",
|
|
|
|
value: true,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
typing__start: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "typing",
|
|
|
|
op: "start",
|
2020-07-25 22:58:18 +02:00
|
|
|
sender: typing_person1,
|
|
|
|
recipients: [typing_person2],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
typing__stop: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "typing",
|
|
|
|
op: "stop",
|
2020-07-25 22:58:18 +02:00
|
|
|
sender: typing_person1,
|
|
|
|
recipients: [typing_person2],
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__color_scheme_automatic: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "color_scheme",
|
|
|
|
setting: 1,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__color_scheme_dark: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "color_scheme",
|
|
|
|
setting: 2,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__color_scheme_light: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "color_scheme",
|
|
|
|
setting: 3,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__default_language: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "default_language",
|
|
|
|
setting: "fr",
|
|
|
|
language_name: "French",
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__demote_inactive_streams: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "demote_inactive_streams",
|
|
|
|
setting: 2,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__dense_mode: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "dense_mode",
|
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-05-16 13:13:59 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__emojiset: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "emojiset",
|
|
|
|
setting: "google",
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__fluid_layout_width: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "fluid_layout_width",
|
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__high_contrast_mode: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "high_contrast_mode",
|
2020-06-12 20:26:04 +02:00
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__left_side_userlist: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "left_side_userlist",
|
2020-06-12 20:26:04 +02:00
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__starred_message_counts: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "starred_message_counts",
|
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
update_display_settings__translate_emoticons: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
|
|
|
setting_name: "translate_emoticons",
|
2020-06-12 20:26:04 +02:00
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 14:05:55 +02:00
|
|
|
update_display_settings__twenty_four_hour_time: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_display_settings",
|
2020-07-29 14:05:55 +02:00
|
|
|
setting_name: "twenty_four_hour_time",
|
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
update_global_notifications: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_global_notifications",
|
|
|
|
notification_name: "enable_stream_audible_notifications",
|
2020-06-12 20:26:04 +02:00
|
|
|
setting: true,
|
2020-08-18 15:32:33 +02:00
|
|
|
user: test_user.email,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
update_message_flags__read: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_message_flags",
|
2020-08-19 21:51:47 +02:00
|
|
|
op: "add",
|
2020-07-15 01:29:15 +02:00
|
|
|
operation: "add",
|
|
|
|
flag: "read",
|
2020-06-12 20:26:04 +02:00
|
|
|
messages: [999],
|
2020-07-25 23:12:51 +02:00
|
|
|
all: false,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
update_message_flags__starred_add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_message_flags",
|
2020-08-19 21:51:47 +02:00
|
|
|
op: "add",
|
2020-07-15 01:29:15 +02:00
|
|
|
operation: "add",
|
|
|
|
flag: "starred",
|
2020-06-12 20:26:04 +02:00
|
|
|
messages: [exports.test_message.id],
|
2020-07-25 23:12:51 +02:00
|
|
|
all: false,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
update_message_flags__starred_remove: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "update_message_flags",
|
2020-08-19 21:51:47 +02:00
|
|
|
op: "remove",
|
2020-07-15 01:29:15 +02:00
|
|
|
operation: "remove",
|
|
|
|
flag: "starred",
|
2020-06-12 20:26:04 +02:00
|
|
|
messages: [exports.test_message.id],
|
2020-07-25 23:12:51 +02:00
|
|
|
all: false,
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
user_group__add: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_group",
|
|
|
|
op: "add",
|
2020-06-12 20:26:04 +02:00
|
|
|
group: {
|
2020-07-25 23:14:28 +02:00
|
|
|
id: 555,
|
2020-07-15 01:29:15 +02:00
|
|
|
name: "Mobile",
|
2020-07-25 23:14:28 +02:00
|
|
|
description: "mobile folks",
|
2020-06-12 20:26:04 +02:00
|
|
|
members: [1],
|
|
|
|
},
|
|
|
|
},
|
2020-07-29 14:05:55 +02:00
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
user_group__add_members: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_group",
|
|
|
|
op: "add_members",
|
2020-06-12 20:26:04 +02:00
|
|
|
group_id: 1,
|
|
|
|
user_ids: [2],
|
|
|
|
},
|
2020-07-29 14:05:55 +02:00
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
user_group__remove_members: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_group",
|
|
|
|
op: "remove_members",
|
2020-06-12 20:26:04 +02:00
|
|
|
group_id: 3,
|
|
|
|
user_ids: [99, 100],
|
|
|
|
},
|
2020-07-29 14:05:55 +02:00
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
user_group__update: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_group",
|
|
|
|
op: "update",
|
2020-06-12 20:26:04 +02:00
|
|
|
group_id: 3,
|
|
|
|
data: {
|
2020-07-15 01:29:15 +02:00
|
|
|
name: "Frontend",
|
|
|
|
description: "All Frontend people",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
},
|
2020-07-29 14:05:55 +02:00
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
user_status__revoke_away: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_status",
|
2020-06-12 20:26:04 +02:00
|
|
|
user_id: 63,
|
|
|
|
away: false,
|
|
|
|
},
|
2020-07-29 14:05:55 +02:00
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
user_status__set_away: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_status",
|
2020-06-12 20:26:04 +02:00
|
|
|
user_id: 55,
|
|
|
|
away: true,
|
|
|
|
},
|
2020-07-29 14:05:55 +02:00
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
user_status__set_status_text: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "user_status",
|
2020-08-18 15:32:33 +02:00
|
|
|
user_id: test_user.user_id,
|
2020-07-15 01:29:15 +02:00
|
|
|
status_text: "out to lunch",
|
2020-06-12 20:26:04 +02:00
|
|
|
},
|
|
|
|
};
|