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;
|
|
|
|
|
2021-06-09 13:31:39 +02:00
|
|
|
// TODO: we want to validate this better with check-schema.
|
|
|
|
// The data should mostly be representative here, but we don't
|
|
|
|
// really exercise it in our tests yet.
|
|
|
|
const message_detail = {
|
|
|
|
type: "stream",
|
|
|
|
mentioned: false,
|
|
|
|
sender_id: test_user.id,
|
|
|
|
stream_id: streams.devel.test_id,
|
|
|
|
};
|
|
|
|
|
2020-08-05 19:04:27 +02:00
|
|
|
exports.test_realm_emojis = {
|
|
|
|
101: {
|
|
|
|
id: "101",
|
|
|
|
name: "spain",
|
2021-08-12 10:20:50 +02:00
|
|
|
source_url: "/some/path/to/spain.gif",
|
|
|
|
still_url: "/some/path/to/spain.png",
|
2020-08-05 19:04:27 +02:00
|
|
|
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",
|
2021-12-29 16:16:15 +01:00
|
|
|
still_url: null,
|
2020-08-05 19:04:27 +02:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
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
|
|
|
},
|
|
|
|
|
2021-03-26 09:51:43 +01:00
|
|
|
custom_profile_fields: {
|
2020-07-29 14:05:55 +02:00
|
|
|
type: "custom_profile_fields",
|
|
|
|
fields: [
|
2021-03-26 09:51:43 +01:00
|
|
|
{id: 1, name: "teams", type: 1, hint: "", field_data: "", order: 1},
|
|
|
|
{id: 2, name: "hobbies", type: 1, hint: "", field_data: "", order: 2},
|
2020-07-29 14:05:55 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
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
|
|
|
},
|
|
|
|
|
2021-03-27 12:42:16 +01:00
|
|
|
muted_users: {
|
|
|
|
type: "muted_users",
|
|
|
|
muted_users: [
|
|
|
|
{
|
|
|
|
id: 5,
|
|
|
|
timestamp: fake_then,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 23,
|
|
|
|
timestamp: fake_now,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
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",
|
2021-03-13 20:00:05 +01:00
|
|
|
realm_id: 2,
|
2020-07-29 14:05:55 +02:00
|
|
|
},
|
|
|
|
|
2020-07-29 13:19:47 +02:00
|
|
|
realm__update__bot_creation_policy: {
|
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "bot_creation_policy",
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
|
2021-03-27 05:48:37 +01:00
|
|
|
realm__update__create_private_stream_policy: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
2021-03-27 05:48:37 +01:00
|
|
|
property: "create_private_stream_policy",
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
|
|
|
|
realm__update__create_public_stream_policy: {
|
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "create_public_stream_policy",
|
2020-06-12 20:26:04 +02:00
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
|
2021-11-24 15:29:25 +01:00
|
|
|
realm__update__create_web_public_stream_policy: {
|
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "create_web_public_stream_policy",
|
|
|
|
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__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
|
|
|
},
|
|
|
|
|
2021-11-24 19:23:52 +01:00
|
|
|
realm__update__enable_spectator_access: {
|
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "enable_spectator_access",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
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
|
|
|
},
|
|
|
|
|
2021-04-04 15:47:33 +02:00
|
|
|
realm__update__invite_to_realm_policy: {
|
|
|
|
type: "realm",
|
|
|
|
op: "update",
|
|
|
|
property: "invite_to_realm_policy",
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
|
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
|
|
|
},
|
|
|
|
|
2021-03-30 12:51:54 +02:00
|
|
|
realm_linkifiers: {
|
|
|
|
type: "realm_linkifiers",
|
|
|
|
realm_linkifiers: [
|
|
|
|
{
|
|
|
|
pattern: "#[123]",
|
|
|
|
url_format: "ticket %(id)s",
|
|
|
|
id: 55,
|
|
|
|
},
|
|
|
|
],
|
2020-07-29 14:05:55 +02:00
|
|
|
},
|
|
|
|
|
2021-04-16 04:04:18 +02:00
|
|
|
realm_playgrounds: {
|
|
|
|
type: "realm_playgrounds",
|
|
|
|
realm_playgrounds: [
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
name: "Lean playground",
|
|
|
|
pygments_language: "Lean",
|
|
|
|
url_prefix: "https://leanprover.github.io/live/latest/#code=",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
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,
|
2021-05-28 12:51:50 +02:00
|
|
|
is_billing_admin: false,
|
2021-04-11 07:38:09 +02:00
|
|
|
role: 400,
|
2020-08-14 02:45:53 +02:00
|
|
|
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
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2021-08-30 16:26:38 +02:00
|
|
|
realm_user_settings_defaults__emojiset: {
|
|
|
|
type: "realm_user_settings_defaults",
|
|
|
|
op: "update",
|
|
|
|
property: "emojiset",
|
|
|
|
value: "google",
|
|
|
|
},
|
|
|
|
|
2021-09-16 12:47:12 +02:00
|
|
|
realm_user_settings_defaults__notification_sound: {
|
|
|
|
type: "realm_user_settings_defaults",
|
|
|
|
op: "update",
|
|
|
|
property: "notification_sound",
|
|
|
|
value: "ding",
|
|
|
|
},
|
|
|
|
|
2021-08-30 09:51:38 +02:00
|
|
|
realm_user_settings_defaults__presence_enabled: {
|
|
|
|
type: "realm_user_settings_defaults",
|
|
|
|
op: "update",
|
|
|
|
property: "presence_enabled",
|
|
|
|
value: false,
|
|
|
|
},
|
|
|
|
|
2020-06-12 20:26:04 +02:00
|
|
|
restart: {
|
2020-07-15 01:29:15 +02:00
|
|
|
type: "restart",
|
2021-04-18 11:28:39 +02:00
|
|
|
zulip_version: "4.0-dev+git",
|
2021-07-30 12:25:53 +02:00
|
|
|
zulip_merge_base: "",
|
2021-04-18 11:28:39 +02:00
|
|
|
zulip_feature_level: 55,
|
2021-03-13 22:32:51 +01:00
|
|
|
server_generation: 2,
|
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-17 14:39:33 +02:00
|
|
|
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-12-24 21:00:20 +01:00
|
|
|
message_type: "private",
|
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-12-24 21:00:20 +01:00
|
|
|
message_type: "private",
|
2020-07-25 22:58:18 +02:00
|
|
|
sender: typing_person1,
|
|
|
|
recipients: [typing_person2],
|
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
|
|
|
},
|
|
|
|
|
2021-06-09 13:31:39 +02:00
|
|
|
update_message_flags__read_remove: {
|
|
|
|
type: "update_message_flags",
|
|
|
|
op: "remove",
|
|
|
|
operation: "remove",
|
|
|
|
flag: "read",
|
|
|
|
messages: [888],
|
|
|
|
message_details: {888: message_detail},
|
|
|
|
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],
|
2021-08-06 19:31:00 +02:00
|
|
|
is_system_group: false,
|
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_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
|
|
|
|
2021-03-26 18:25:36 +01:00
|
|
|
user_group__remove: {
|
|
|
|
type: "user_group",
|
|
|
|
op: "remove",
|
|
|
|
group_id: 1,
|
|
|
|
},
|
|
|
|
|
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
|
|
|
|
2021-07-27 19:02:05 +02:00
|
|
|
user_settings__color_scheme_automatic: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "color_scheme",
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__color_scheme_dark: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "color_scheme",
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__color_scheme_light: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "color_scheme",
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__default_language: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "default_language",
|
|
|
|
value: "fr",
|
|
|
|
language_name: "French",
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__default_view_all_messages: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "default_view",
|
|
|
|
value: "all_messages",
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__default_view_recent_topics: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "default_view",
|
|
|
|
value: "recent_topics",
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__demote_inactive_streams: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "demote_inactive_streams",
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__dense_mode: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "dense_mode",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__emojiset: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "emojiset",
|
|
|
|
value: "google",
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__enable_stream_audible_notifications: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "enable_stream_audible_notifications",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__enter_sends: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "enter_sends",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
2021-10-25 19:17:19 +02:00
|
|
|
user_settings__escape_navigates_to_default_view: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "escape_navigates_to_default_view",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
2021-07-27 19:02:05 +02:00
|
|
|
user_settings__fluid_layout_width: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "fluid_layout_width",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__high_contrast_mode: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "high_contrast_mode",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__left_side_userlist: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "left_side_userlist",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
2021-09-17 13:14:04 +02:00
|
|
|
user_settings__presence_enabled: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "presence_enabled",
|
|
|
|
value: false,
|
|
|
|
},
|
|
|
|
|
2021-07-27 19:02:05 +02:00
|
|
|
user_settings__starred_message_counts: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "starred_message_counts",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__translate_emoticons: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "translate_emoticons",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
user_settings__twenty_four_hour_time: {
|
|
|
|
type: "user_settings",
|
|
|
|
op: "update",
|
|
|
|
property: "twenty_four_hour_time",
|
|
|
|
value: true,
|
|
|
|
},
|
|
|
|
|
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
|
|
|
|
2021-06-27 19:04:17 +02:00
|
|
|
user_status__set_status_emoji: {
|
|
|
|
type: "user_status",
|
|
|
|
user_id: test_user.user_id,
|
|
|
|
emoji_name: "smiley",
|
|
|
|
emoji_code: "1f603",
|
|
|
|
reaction_type: "unicode_emoji",
|
|
|
|
},
|
|
|
|
|
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
|
|
|
},
|
|
|
|
};
|