2021-03-25 22:35:45 +01:00
|
|
|
import $ from "jquery";
|
2020-04-04 01:47:18 +02:00
|
|
|
|
2020-01-15 16:41:56 +01:00
|
|
|
const t1 = performance.now();
|
2021-05-27 20:08:50 +02:00
|
|
|
export const page_params: {
|
2023-03-29 18:36:52 +02:00
|
|
|
apps_page_url: string;
|
|
|
|
corporate_enabled: boolean;
|
2021-05-27 20:08:50 +02:00
|
|
|
language_list: {
|
|
|
|
code: string;
|
|
|
|
locale: string;
|
|
|
|
name: string;
|
|
|
|
percent_translated: number | undefined;
|
|
|
|
}[];
|
2021-06-06 22:13:18 +02:00
|
|
|
development_environment: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
is_admin: boolean;
|
2023-07-12 07:22:30 +02:00
|
|
|
is_bot: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
is_guest: boolean;
|
|
|
|
is_moderator: boolean;
|
2021-11-19 17:36:00 +01:00
|
|
|
is_owner: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
is_spectator: boolean;
|
2023-05-11 11:44:10 +02:00
|
|
|
needs_tutorial: boolean;
|
|
|
|
page_load_time: number;
|
2023-03-29 18:36:52 +02:00
|
|
|
promote_sponsoring_zulip: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_add_custom_emoji_policy: number;
|
|
|
|
realm_avatar_changes_disabled: boolean;
|
2021-03-27 05:48:37 +01:00
|
|
|
realm_create_private_stream_policy: number;
|
|
|
|
realm_create_public_stream_policy: number;
|
2021-11-19 17:36:00 +01:00
|
|
|
realm_create_web_public_stream_policy: number;
|
2021-06-23 12:53:38 +02:00
|
|
|
realm_delete_own_message_policy: number;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_edit_topic_policy: number;
|
2022-12-09 17:34:00 +01:00
|
|
|
realm_email_changes_disabled: boolean;
|
2021-11-19 17:36:00 +01:00
|
|
|
realm_enable_spectator_access: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_invite_to_realm_policy: number;
|
|
|
|
realm_invite_to_stream_policy: number;
|
2023-07-24 16:49:26 +02:00
|
|
|
realm_is_zephyr_mirror_realm: boolean;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_move_messages_between_streams_policy: number;
|
|
|
|
realm_name_changes_disabled: boolean;
|
2023-03-29 18:36:52 +02:00
|
|
|
realm_name: string;
|
2023-07-25 19:22:22 +02:00
|
|
|
realm_notifications_stream_id: number;
|
2023-03-29 18:36:52 +02:00
|
|
|
realm_org_type: number;
|
|
|
|
realm_plan_type: number;
|
2023-07-12 07:22:30 +02:00
|
|
|
realm_private_message_policy: number;
|
2021-07-23 19:42:57 +02:00
|
|
|
realm_push_notifications_enabled: boolean;
|
sentry: Add frontend event monitoring.
Zulip already has integrations for server-side Sentry integration;
however, it has historically used the Zulip-specific `blueslip`
library for monitoring browser-side errors. However, the latter sends
errors to email, as well optionally to an internal `#errors` stream.
While this is sufficient for low volumes of users, and useful in that
it does not rely on outside services, at higher volumes it is very
difficult to do any analysis or filtering of the errors. Client-side
errors are exceptionally noisy, with many false positives due to
browser extensions or similar, so determining real real errors from a
stream of un-grouped emails or messages in a stream is quite
difficult.
Add a client-side Javascript sentry integration. To provide useful
backtraces, this requires extending the pre-deploy hooks to upload the
source-maps to Sentry. Additional keys are added to the non-public
API of `page_params` to control the DSN, realm identifier, and sample
rates.
2023-02-13 20:50:57 +01:00
|
|
|
realm_sentry_key: string | undefined;
|
|
|
|
realm_uri: string;
|
2021-07-28 18:55:53 +02:00
|
|
|
realm_user_group_edit_policy: number;
|
|
|
|
realm_waiting_period_threshold: number;
|
2021-05-27 20:08:50 +02:00
|
|
|
request_language: string;
|
2021-07-28 18:55:53 +02:00
|
|
|
server_avatar_changes_disabled: boolean;
|
|
|
|
server_name_changes_disabled: boolean;
|
2023-03-29 18:36:52 +02:00
|
|
|
server_needs_upgrade: boolean;
|
2023-08-15 04:20:37 +02:00
|
|
|
server_presence_offline_threshold_seconds: number;
|
sentry: Add frontend event monitoring.
Zulip already has integrations for server-side Sentry integration;
however, it has historically used the Zulip-specific `blueslip`
library for monitoring browser-side errors. However, the latter sends
errors to email, as well optionally to an internal `#errors` stream.
While this is sufficient for low volumes of users, and useful in that
it does not rely on outside services, at higher volumes it is very
difficult to do any analysis or filtering of the errors. Client-side
errors are exceptionally noisy, with many false positives due to
browser extensions or similar, so determining real real errors from a
stream of un-grouped emails or messages in a stream is quite
difficult.
Add a client-side Javascript sentry integration. To provide useful
backtraces, this requires extending the pre-deploy hooks to upload the
source-maps to Sentry. Additional keys are added to the non-public
API of `page_params` to control the DSN, realm identifier, and sample
rates.
2023-02-13 20:50:57 +01:00
|
|
|
server_sentry_dsn: string | undefined;
|
|
|
|
server_sentry_environment: string | undefined;
|
|
|
|
server_sentry_sample_rate: number | undefined;
|
|
|
|
server_sentry_trace_rate: number | undefined;
|
2021-11-19 17:36:00 +01:00
|
|
|
server_web_public_streams_enabled: boolean;
|
2023-03-29 18:36:52 +02:00
|
|
|
show_billing: boolean;
|
|
|
|
show_plans: boolean;
|
|
|
|
show_webathena: boolean;
|
2021-05-27 20:08:50 +02:00
|
|
|
translation_data: Record<string, string>;
|
sentry: Add frontend event monitoring.
Zulip already has integrations for server-side Sentry integration;
however, it has historically used the Zulip-specific `blueslip`
library for monitoring browser-side errors. However, the latter sends
errors to email, as well optionally to an internal `#errors` stream.
While this is sufficient for low volumes of users, and useful in that
it does not rely on outside services, at higher volumes it is very
difficult to do any analysis or filtering of the errors. Client-side
errors are exceptionally noisy, with many false positives due to
browser extensions or similar, so determining real real errors from a
stream of un-grouped emails or messages in a stream is quite
difficult.
Add a client-side Javascript sentry integration. To provide useful
backtraces, this requires extending the pre-deploy hooks to upload the
source-maps to Sentry. Additional keys are added to the non-public
API of `page_params` to control the DSN, realm identifier, and sample
rates.
2023-02-13 20:50:57 +01:00
|
|
|
user_id: number | undefined;
|
|
|
|
webpack_public_path: string;
|
2021-07-28 18:55:53 +02:00
|
|
|
zulip_plan_is_not_limited: boolean;
|
2023-03-29 18:36:52 +02:00
|
|
|
zulip_merge_base: string;
|
sentry: Add frontend event monitoring.
Zulip already has integrations for server-side Sentry integration;
however, it has historically used the Zulip-specific `blueslip`
library for monitoring browser-side errors. However, the latter sends
errors to email, as well optionally to an internal `#errors` stream.
While this is sufficient for low volumes of users, and useful in that
it does not rely on outside services, at higher volumes it is very
difficult to do any analysis or filtering of the errors. Client-side
errors are exceptionally noisy, with many false positives due to
browser extensions or similar, so determining real real errors from a
stream of un-grouped emails or messages in a stream is quite
difficult.
Add a client-side Javascript sentry integration. To provide useful
backtraces, this requires extending the pre-deploy hooks to upload the
source-maps to Sentry. Additional keys are added to the non-public
API of `page_params` to control the DSN, realm identifier, and sample
rates.
2023-02-13 20:50:57 +01:00
|
|
|
zulip_version: string;
|
2022-12-27 13:49:03 +01:00
|
|
|
muted_users: {id: number; timestamp: number}[];
|
2021-05-27 20:08:50 +02:00
|
|
|
} = $("#page-params").remove().data("params");
|
2020-01-15 16:41:56 +01:00
|
|
|
const t2 = performance.now();
|
2021-06-22 18:58:47 +02:00
|
|
|
export const page_params_parse_time = t2 - t1;
|
2021-03-25 22:35:45 +01:00
|
|
|
if (!page_params) {
|
2019-09-20 06:58:12 +02:00
|
|
|
throw new Error("Missing page-params");
|
|
|
|
}
|