Commit Graph

675 Commits

Author SHA1 Message Date
sahil839 e0faa9699d api: Remove incorrect realm setting in 'realm/update_dict' schema.
We incorrectly include many realm settings in the data section of
'realm/update_dict' schema. It should only contain the settings
related to message edit, realm icon, realm logo and authentication
methods and not other settings, becausea all the other settings send
'realm/update' event and not 'realm/update_dict' event.

This commit only removes 'add_emoji_by_admins_only' and others will
be removed separately.
2021-07-14 14:57:09 -07:00
sahil839 50240ca71b models: Use COMMON_POLICY_TYPES for user_group_edit_policy.
This commit adds moderators and full members options for
user_group_edit_policy by using COMMON_POLICY_TYPES.

Moderators do not require to be a member of user group in
order to edit or remove the user group if they are allowed
to do so according to user_group_edit_policy.
But full members need to be a member of user group to edit
or remove the user group.
2021-07-14 14:38:44 -07:00
Suyash Vardhan Mathur 309f4ba145 openapi: Make endpoint operationId dash-separated.
The operationId is directly used in URLs of API doc pages
to find the OpenAPI data to render. However, this is dash-
separated in the URLs, and having underscore_separated IDs
in OpenAPI data doesn't allow direct comparison of the two.

This commit changes all OperationIDs from underscore_separated
to dash-separated.
2021-07-13 16:46:22 -07:00
Suyash Vardhan Mathur 981e4f8946
openapi: Render all responses of an operation.
Previously, one needed to specifying all the HTTP status
codes that we want to render along with the operation,
but the primary use case just needs the responses of
all the status codes, and not just one.

This commit modifies the Markdown extension to render
all the responses of all status codes of a specified
operation in a loop.
2021-07-13 08:33:43 -07:00
Mateusz Mandera ab380b122b python_examples: Use ensure_users where appropriate.
We added this function in 8e1a7cfb52
in order to make things more readable in example which hard-code user
ids. The point is to validate that the id indeed refers to the user that
the person writing the example expects, while providing information to
readers of the code so they don't have to do db queries to figure out
the user. As mentioned in the commit referred to above, this is
particularly useful when some db changes cause renumbering of user ids -
because then all these ids have to be adjusted and it's nice to know the
intended user.
2021-07-13 08:24:06 -07:00
Gaurav Pandey d2074fc10c events: Remove `sender_id` from `delete_message` event.
Remove `sender_id` as part of responses from `/events`
api for `delete_message` event when `message_type` is
`private`.
2021-07-08 13:40:32 -07:00
Gaurav Pandey bc131c1636 events: Remove `recipient_id` from `delete_message` event.
Remove `recipient_id` from `delete_message` event response
when `message_type` is `private`. API changelog updated in
next commit.
2021-07-08 13:36:45 -07:00
Tim Abbott af47fa705e exceptions: Use HTTP 401 code for authentication errors. 2021-07-08 10:33:08 -07:00
Vishnu KS 4ad592ed4f populate_db: Use do_create_realm for creating zulip realm.
Since do_create_realm also creates general and core team streams,
we rename general to verona right after the realm is created. Mostly
because we dont really want two additional streams and this might
probably make it easy to review things.

There are puppeteer test changes because, we have a new "core team"
stream in tests as well as there is a new default notification stream
"Verona". Because of this tests in message-basics for example have
to be changed since the newly added core team affects the order in
which we navigate through the streams using arrow keys.

The extra await for selector was added in subscriptions test to make
the tests wait. Without the await the tests were passing ocassionally
and failing in some other times.

Fixes #6967
2021-07-06 17:37:43 -07:00
Vishnu KS acffc0ae0a populate_db: Use do_create_realm for creating zephyr realm. 2021-07-06 17:22:00 -07:00
Suyash Vardhan Mathur acb1244f93 api docs: Move stray get_events Python example.
We also remove the call_on_each_event note, which has been misplaced
ever since we created the "real-time-events" page.
2021-07-06 10:17:03 -07:00
Suyash Vardhan Mathur 7bbafbc881 python_examples: Add auto-rendering of extra imports.
Currently, there is no provision of rendering
additional imports automatically, and those examples
were hardcoded in the templates.

This commit adds an openapi parameter
to store the additional imports required for the endpoint.
Further, it changes code to replace `import zulip`
with the modified imports.
2021-07-06 10:14:46 -07:00
Anders Kaseorg ee8724e436 docs: Correct Big Blue Button to BigBlueButton.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-07-05 16:59:00 -07:00
Anders Kaseorg 24c239d991 openapi: Add missing __init__.py; fix type errors hidden by its absence.
The absence of __init__.py was preventing mypy from following any of
the zerver.openapi imports.  These errors were being silenced by
ignore_missing_imports.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-07-05 12:20:39 -07:00
Tim Abbott 64aa8f80a0 events: Add heartbeat events to tests and documentation.
Heartbeat events are an important part of the API, even though they
are noops, so it's important to document them.
2021-07-01 17:14:32 -07:00
Suyash Vardhan Mathur c0615a00e6 openapi: Fix response description in outgoing-webhooks.
A response description was hardcoded in the template,
and the OpenAPI description was wrongly written. This commit
fixes the response description.
2021-07-01 11:20:37 -07:00
Suyash Vardhan Mathur ba36d46658 openapi: Add response descriptions for rest-error-handling.
Some response descriptions weren't migrated into
OpenAPI data, which was done for other API pages.
This commit migrates the response descriptions for
error-handling page.
2021-07-01 11:20:37 -07:00
Tim Abbott 0997eeae9e api docs: Document rate limiting rules.
Unfortunately, the example doesn't work due to some sort of bug with
the fixture generation system, which I've reported as #19072.
2021-06-30 13:40:07 -07:00
sahil839 2bf19d5651 api: Remove incorrect realm setting in 'realm/update_dict' schema.
We incorrectly include many realm settings in the data section of
'realm/update_dict' schema. It should only contain the settings
related to message edit, realm icon, realm logo and authentication
methods and not other settings, becausea all the other settings send
'realm/update' event and not 'realm/update_dict' event.

This commit only removes 'allow_message_deleting' and others will
be removed separately.
2021-06-29 17:37:52 -07:00
Tim Abbott 8aa05620d2 help: Document resolving topics. 2021-06-24 13:57:02 -07:00
Suyash Vardhan Mathur 0c4330f926 openapi: Automatically add python tab whenever required.
As a part of goal of moving towards a common template,
the hardcoded python tabs need to be removed to ensure
that endpoints which don't have python examples can be
covered by the common template as well.

This commit also modifies the markdown extension for python
examples to render empty string in case the examples don't
exist, which would allow it to be called whether the endpoint
has python examples or not.
2021-06-24 10:38:44 -07:00
Tim Abbott 6b67b18c4b api docs: Clarify limits on use of propagate_mode. 2021-06-24 09:57:13 -07:00
Suyash Vardhan Mathur e892a02bb8 curl_examples: Fix curl testing for template's examples.
AUTHENTICATION LINE variable needs to be set after each
line executed, but in the current code, it wasn't being
set in endpoints whose files were removed in favour of
the pages being generated directly from OpenAPI data.

Moved the block to set AUTHENTICATION LINE in the loop
which executes each command, which fixes the bug.
2021-06-23 16:12:18 -07:00
Suyash Vardhan Mathur d0e44eaaae openapi: Move stray register-queue description into OpenAPI. 2021-06-23 16:12:18 -07:00
Suyash Vardhan Mathur dd7c3de36f openapi: Move stray get-user-groups description into OpenAPI. 2021-06-23 16:09:36 -07:00
Suyash Vardhan Mathur 7f8d8e0a9c openapi: Move stray update-notification-settings description into OpenAPI. 2021-06-23 16:05:47 -07:00
Suyash Vardhan Mathur 3129895818 openapi: Move stray custom emoji description into OpenAPI. 2021-06-22 17:39:29 -07:00
Suyash Vardhan Mathur 3f104c378b openapi: Move stray get messages description into OpenAPI. 2021-06-22 17:39:22 -07:00
Suyash Vardhan Mathur 570f3d350c apidocs: Move stray update message description to OpenAPI. 2021-06-22 17:39:17 -07:00
Suyash Vardhan Mathur f90b23b265 apidocs: Move stray upload file description to OpenAPI. 2021-06-22 17:39:12 -07:00
Suyash Vardhan Mathur 987b7206aa apidocs: Move stray display settings description to OpenAPI. 2021-06-22 17:39:06 -07:00
Suyash Vardhan Mathur 78910ec16a apidocs: Move stray message flags description to OpenAPI. 2021-06-22 17:38:51 -07:00
Suyash Vardhan Mathur 550e43bb9f apidocs: Move stray events description text to OpenAPI. 2021-06-22 17:38:34 -07:00
Suyash Vardhan Mathur d6ed38e0c9 apidocs: Move stray server settings description to OpenAPI. 2021-06-22 17:38:30 -07:00
Suyash Vardhan Mathur aedca6d6c6 apidocs: Move stray message history description to OpenAPI. 2021-06-22 17:38:10 -07:00
Suyash Vardhan Mathur 8d7634a572 apidocs: Move stray events description to OpenAPI. 2021-06-22 17:38:06 -07:00
Suyash Vardhan Mathur 8da27b8a5b apidocs: Move stray delete description reference to OpenAPI. 2021-06-22 17:37:44 -07:00
Suyash Vardhan Mathur 35ba5b8d6f openapi: Add markdown extension for parameter descriptions.
As a goal of a common template, there
is a need for a tool to auto-generate
general description for all parameters
directly from OpenAPI data.

This description is to be stored in
x-response-description field, and this
commit adds a markdown extesion to process the same.
2021-06-22 10:58:43 -07:00
Suyash Vardhan Mathur dbcffebf2c openapi: Add markdown extension for response descriptions.
As a goal of a common template, there
is a need for a tool to auto-generate
general description for all responses
directly from OpenAPI data.

This description is to be stored in
x-response-description field, and this
commit adds a markdown extesion to process the same.
2021-06-22 10:58:43 -07:00
sahil839 5a47e1f289 api: Remove incorrect realm setting in 'realm/update_dict' schema.
We incorrectly include many realm settings in the data section of
'realm/update_dict' schema. It should only contain the settings
related to message edit, realm icon, realm logo and authentication
methods and not other settings, becausea all the other settings send
'realm/update' event and not 'realm/update_dict' event.

This commit only removes 'default_twenty_four_hour_time' and
'default_language', others will be removed separately.
2021-06-21 11:30:57 -07:00
Suyash Vardhan Mathur e5221a8434 curl_examples: Fix curl testing for multiple configs.
Now, the markdown extension of curl_examples generates
all examples of all possible configurations with
their descriptions, and so we need to separate
executable curl commands from the rest of the raw
HTML.

This commit simply changes the indentation of the
block and replaces the command being tested
with each element of the commands array. This
was split for an easier review.
2021-06-21 11:06:05 -07:00
Suyash Vardhan Mathur acbae4b6cf curl_examples: Fix curl testing for multiple configs.
Now, the markdown extension of curl_examples generates
all examples of all possible configurations with
their descriptions, and so we need to separate
executable curl commands from the rest of the raw
HTML.

This commit adds a commands variable to store
all the curl commands in HTML using regex.
2021-06-21 11:06:05 -07:00
Suyash Vardhan Mathur 6bd11285c1 openapi: Fix minor assertion in curl examples.
Now, include and exclude configuration
are fetched from openapi data, and only
one type can be encoded for every example.

This removes the need for the assertion to
test if both include and exclude are present
since at a time, only one can be present.
2021-06-21 11:06:05 -07:00
Suyash Vardhan Mathur 246262fb57 openapi: Modify curl example generation logic.
This commit adds support for using the
x-curl-examples-parameters parameter in OpenAPI
data to fetch curl examples configuration. This
also contains any descriptions necessary for each
example, and directly generates all possible
curl examples directly.

A follow-up commit is needed to modify the templates
accordingly.
2021-06-21 11:06:05 -07:00
Suyash Vardhan Mathur a56ad2a26a openapi: Add curl examples' configurations in OpenAPI data.
As a goal of moving towards a common template,
we need to fetch curl examples' configurations
directly from openapi data instead of having them
hardcoded in templates. This commit introduces
x-curl-examples-parameters to store the configs
for the same.
2021-06-21 11:06:05 -07:00
sahil839 38fac6c359 settings: Add moderators and members options in edit_topic_policy.
This commit adds moderators, full members and members options for
edit_topic_policy in both the backend and frontend.
2021-06-16 15:04:29 -07:00
sahil839 828759d2ba models: Replace allow_community_topic_editing with edit_topic_policy.
This commit replaces the allow_community_topic_editing boolean with
integer field edit_topic_policy and includes both frontend and
backend changes.

We also update settings_ui.disable_sub_settings_onchange to not
change the color of label as we did previously when the setting
was a checkbox. But now as the setting is dropdown we keep the
label as it is and we don't do anything with label when disabling
dropdowns. Also, this function was used only here so we can safely
change this.
2021-06-16 14:59:36 -07:00
Suyash Vardhan Mathur 1acee9f516 apidocs: Migrate admin_config out of templates.
Currently, the `admin_config` configuration was
hardcoded in the templates, but as a goal of creating
a common template, we need to move all configurations
outside.

Moved the checking for function and language which need
admin_config out of templates into the code and added a
boolean `x-admin-config` to store whehter the operation
requires admin config.

Also, added the banner for admin access to auto-generate
if admin_config is present, and fixed the admin_config
for endpoints that were earlier missing it in the templates.
2021-06-16 09:52:43 -07:00
Aman Agrawal 64f04e9913 web_public_view: Replace `web_public_visitor` with `spectator`.
We use `spectator` term instead of `web_public_visitor` as it is
more concise and better represents this type of users.
2021-06-16 07:46:34 -07:00
Suyash Vardhan Mathur 274f73d117 apidocs: Automatically add javascript example tabs.
The javascript tab in .md templates can be
generated along with the line that adds js
example.

Further, as a part of the effort of moving
towards a single template, the markdown extension
for javascrit examples is modified to return empty
string if javascript example doesn't exist for that
endpoint. This would make it possible to cover more
endpoints with a single template.

The js example tabs are now automatically generated
during generation of javascript code, and so need to
be removed. Also, the markdown function to render js
examples can be added in all templates, since it is
parses and returns an empty string if the examples
don't exist, and allows us to move towards a common
template.

The pages have been verified to be correct
by using diff between old and new pages' raw HTML.
2021-06-11 07:43:22 -07:00
Suyash Vardhan Mathur 6692250858 openapi: Enhance markdown extension for responses.
Currently, the descriptions for API responses were
hardcoded in the templates. However, they now exist
in YAML data as well, and so can be fetched from there.

Also, as a part of moving towards a common template, it is
beneficial to show return response description along with
the code example directly. Also, for the same reason, the
need for mentioning subschemas for the response has been
removed, and ALL responses for that response code should
be returned in the proper format.

This also includes returning empty string if that response
code doesn't exist. This allows us to directly mention both
200 and 400 responses in all templates, and they are parsed
automatically.

A followup is necessary to remove the descriptions in the template
as they are duplicated just by this commit
2021-06-09 12:43:12 -07:00
Suyash Vardhan Mathur 38b63a85e2 openapi: Migrate response descriptions into schemas.
Currently, the descriptions of API responses were
hardcoded in the template. However, as a part of the
goal of moving towards a common template, these should
be auto-generated.

This commit copies these descriptions into the `description`
parameter in the OpenAPI data for that effect.
2021-06-09 12:43:12 -07:00
Anders Kaseorg ad7466a2bf dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-06-08 10:15:52 -07:00
Gaurav Pandey 9b696cf212 api: Expose event_queue_longpoll_timeout_seconds in /register.
Rename poll_timeout to event_queue_longpoll_timeout_seconds
and change its value from 90000 ms to 90 sec. Expose its
value in register api response when realm data is fetched.
Bump API_FEATURE_LEVEL to 74.
2021-06-05 07:37:19 -07:00
Gaurav Pandey 18ef0c3bc1 api: Expose server_needs_upgrade in register response.
Expose the boolean value server_needs_upgrade in the
responses for register api so that it can be used
by mobile and terminal clients as well.
Highlighted in api changelog as part of
feature level 74 in commit fb93c96
(next commit).
2021-06-05 07:33:25 -07:00
Suyash Vardhan Mathur 44c25619d7 curl_examples: Add testing for template endpoints.
This commit adds support for testing of
those endpoints whose .md files would
be deleted in favour of their pages
to be generated automatically by the template.

curl examples for such endpoints must exist
in accordance to the pattern of template, which
can be used to run the tests for them.
2021-06-04 09:43:24 -07:00
Suyash Vardhan Mathur 93cbe6f175 curl_examples: Refactor testing code.
The list curl_commands_to_test gets filled
already and so, the code to test each command
in the list can be moved out of the block that
opens the file. The only change in this commit
is reducing an indentation for the entire block.

This has been done to reuse the whole block
in case the file does not exist.
2021-06-04 09:43:24 -07:00
Suyash Vardhan Mathur 2359ddd402 curl_examples: Refactor testing code.
This commit refactors the code to find the
lines to be first, and then test all the
lines that contained commands.

This was done to avoid duplication of
the code for the other case, where the
.md file won't exist, as those are soon
to be deleted in favour of a common template.
2021-06-04 09:43:24 -07:00
Suyash Vardhan Mathur 64df949f7a curl_examples: Use endpoint list from rest-endpoints.
Soon, the .md files of each endpoint would
be removed and be auto-generated from OpenAPI
data.
So, instead of using the files directly,
we should check from the list of endpoints and
open the files from there.

A follow-up to change logic when the .md files
get deleted should be done.
2021-06-04 09:43:24 -07:00
Vishnu KS 5db53029a5 api: Include is_billing_admin as an attribute in user response.
This is sufficiently useful that it should be made available to clients.
2021-06-03 10:27:07 -07:00
Tim Abbott 05d4c070f4 api docs: Clarify topic and stream_id fields of message edit API. 2021-06-02 08:53:02 -07:00
Suyash Vardhan Mathur db4b674270 apidocs: Fix description of topic parameter in update_message.
The information of topic being required for stream messages
in update_message OperationID wasn't true. Fixed the
incorrect description.
2021-06-02 08:38:00 -07:00
Mateusz Mandera e17758f8ad auth: Implement a generic OpenID Connect backend.
Fixes #11939.
2021-05-28 09:43:06 -07:00
Abhijeet Prasad Bodas 3d99292b4c message edit: Fix `stream_id` description in API docs.
Since caa08d76b5, we no longer have
a common component for stream IDs in zulip.yaml, so we might as
well change the description to be specific and clear.
2021-05-27 22:52:55 -07:00
Suyash Vardhan Mathur 6107679f61 minor: Fix typo in summary.
The summary for add_code_playground wrongly mentions
'Remove' instead of 'Add' in the summary. Fixed the typo.
2021-05-27 16:56:53 -07:00
Suyash Vardhan Mathur 52b9c96c5d apidocs: Add support for using OpenAPI title for /api pages.
The current logic of geneerating HTML titles requires the title to be
present as a heading in the first line of .md file. However, this will
shortly be no longer true for /api pages where these are
auto-generated from OpenAPI data.  Modified the code to fetch the
title from OpenAPI data in case of such pages.
2021-05-26 17:38:01 -07:00
Suyash Vardhan Mathur 58a8009786 apidocs: Add markdown processor for title.
Currently, the title of each endpoint are hardcoded in .md
files, but these are also added in summary parameter of
openapi. Added a markdown processor to insert the title
of a given endpoint.
2021-05-26 17:38:01 -07:00
Suyash Vardhan Mathur 94c4e22898 apidocs: Add summary field to endpoints.
Some pages did not have .md files, and so the summaries for these
was newly written. Commit split for easy review.
2021-05-26 17:38:01 -07:00
Suyash Vardhan Mathur e15af5ae14 apidocs: Add summary field to endpoints.
As a part of effort of removing .md files for /api pages, the
title of each page can be added into the summary OpenAPI
parameter. This also adds a nice summary visible in Swagger
and enhances the documentation. Added the parameter for all endpoints.
2021-05-26 17:38:01 -07:00
Suyash Vardhan Mathur b41be98c42 apidocs: Fix playground URLs and operationIDs.
We standardized on "Code playground" for this feature, so use that
in the URLs and API documentation.
2021-05-26 17:38:00 -07:00
Gaurav Pandey 64bd461bad register api: Rename realm_upload_quota.
Rename `realm_upload_quota` to `realm_upload_quota_mib`
reflecting file size in mebibytes. Update frontend and bump
API_FEATURE_LEVEL.
2021-05-26 11:38:24 -07:00
Gaurav Pandey 1da818f848 register api: Rename max_logo_file_size.
Renaming `max_logo_file_size` to `max_logo_file_size_mib`
reflecting the file size in mebibyte and update the frontend.
2021-05-26 11:38:24 -07:00
Gaurav Pandey 531cf041f1 register api: Rename max_icon_file_size.
Renaming `max_icon_file_size` to `max_icon_file_size_mib`
reflecting the file size in mebibyte and update the frontend.
2021-05-26 11:38:24 -07:00
Gaurav Pandey 38614bbaec events api: Delete incorrect parameter in response.
max_logo_file_size isn't included in the responses
of GET /events api but is mentioned in the api
documentation. Hence it is deleted.
2021-05-26 11:38:24 -07:00
sahil839 8424a82dec setting: Add moderator option in email visibility setting in backend. 2021-05-23 14:20:20 -07:00
Aman Agrawal 70c0abc2e5 do_change_stream_invite_only: Ensure stream is not web public.
When changing stream permissions to invite_only or public, ensure
that stream doesn't have is_web_public set to True.
2021-05-20 15:23:19 -07:00
Tim Abbott 2e67b879ed api: Add server_timestamp to register response.
Since this is currently only useful to interpret presence data, we
send this only if presence is requested.

I'm not sure that server_timestamp is the right name for this field,
but ultimately it should match the main presence API format.
2021-05-20 14:57:34 -07:00
Anders Kaseorg e015f3ed7d docs: Correct “webapp” to “web app”.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-14 13:15:38 -07:00
Abhijeet Prasad Bodas 67cd385cec mute user: Add user documentation page.
Also link to it from the API documentation page,
other help pages, and the confirmation dialog for
muting a user.

With substantial edits by tabbott and alya.
2021-05-10 17:10:40 -07:00
Gaurav Pandey 96e035a2f0 api: Fix encoding of strings in streams endpoint.
* Remove unnecessary json_validator for string parameters.
* Update frontend to pass right parameter.

Bump api feature level and highlight the fix for `emojiset`
parameter of `settings/display` endpoint in zulip.yaml file.

Fixes part of #18035.
2021-05-10 10:29:22 -07:00
Gaurav Pandey 9abe1cafbe api: Fix encoding of strings in display settings endpoint.
* Remove unnecessary json validator for string validator.
* Update frontend to pass right validator.
* Update zulip.yaml to pass right parameter for curl request
  in openapi.
* Update python_examples to pass right paramater.

Fixes part of #18035.
2021-05-10 10:03:32 -07:00
Anders Kaseorg 544bbd5398 docs: Fix capitalization mistakes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 09:57:26 -07:00
Anders Kaseorg d0c6f4f400 python: Strip leading and trailing spaces from docstrings.
This is enforced by Black ≥ 21.4b0.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-07 22:42:39 -07:00
Alya Abbott 279f7b1c8d user docs: Create separate "Code blocks" user documentation page.
* Move the extended documentation of code blocks to a separate page.
* Merge "code playgrounds" documentation to be a section of that page.
* Document copy widget on code blocks.
* This commit changes how we refer to "```python" type syntax for code
  blocks. Instead of being called a syntax highlighting label, this is
  now referred to as a "language tag", since it serves both syntax
  highlighting and playgrounds.
* Remap all the links.
* Advertise this new page in various places that previously did not have a link.
2021-05-05 16:11:21 -07:00
Sumanth V Rao a40fe26586 help: Document playgrounds on /help, /features and /for/open-source.
Linked the Help Center document in places like
    - zulip.yaml (/events, /register/, realm/playgrounds,
                  /realm/playgrounds/{playground_id})
    - /help/format-your-message-using-markdown (Linked to make
      users reading the markdown code block style, aware of this
      feature)
    - /templates/settings/playground_settings_admin.hbs (Linked
      as a reference to read more about playgrounds before
      configuring one)

Also showcase the feature on /features and /for/open-source.
2021-05-04 12:19:01 -07:00
Dinesh e481f0c869 set-typing-status_api: Document `to` as required argument.
This was accidentally removed in 27e4f5da92
as the initial idea was to have another parameter `stream_id`
for stream type messages instead of sending it in this `to` parameter.

Also fixed a description of `to` for `stream` type.
2021-05-04 11:35:36 -07:00
sahil839 6e672ebbee settings: Add moderators option for wildcard_mention_policy. 2021-05-03 12:12:01 -07:00
sahil839 bd78b1ff90 events: Add 'is_moderator' field to the page_params object sent to clients. 2021-04-29 15:18:49 -07:00
sahil839 dc771f3a14 users: Add support for changing user role to moderator in api.
This commit adds backend support for changing a user role to
moderator and also to change role from moderator to any other
role.
2021-04-29 15:17:45 -07:00
sahil839 34f134d58d users: Add role field to user objects returned by format_user_row.
This commit modifies the user objects returned by 'GET /users',
'GET /users/me', 'GET /users/{user_id}' and 'GET /users/{email}'
endpoints to include role field.

We also include role field in the page_params['realm_users'] dict
and in the person object sent in (type="realm_user", op="add")
event.
2021-04-29 15:13:50 -07:00
m-e-l-u-h-a-n 65c400e06d api: Add zulip_version and zulip_feature_level in restart event.
This help mobile and terminal clients understand whether a server
restart changed API feature levels or not, which in turn determines
whether they will need to resynchronize their data.

Also add tests and documentation for this previously undocumented
event type.

Fixes: #18205.
2021-04-29 12:08:15 -07:00
Tim Abbott 2a4452e722 api docs: Document that new messages might be already ready.
This is an important and somewhat subtle detail that we'd like to help
clients implement correctly.
2021-04-29 10:55:25 -07:00
Tim Abbott cf796b4343 api docs: Fix a few more broken markdown links. 2021-04-29 08:59:50 -07:00
Tim Abbott 023ba6a041 api docs: Fix a missing markdown link.
Thanks to Alex Dehnert for finding this.
2021-04-29 08:57:55 -07:00
Tim Abbott 8295bb9181 api docs: Expand further API documentation on update_message event.
These details clarify the roles of `message_id` and `message_ids`, and
should help a great deal in helping clients correctly implement this
critical API endpoint.
2021-04-29 08:56:46 -07:00
Tim Abbott 339b50fa46 api docs: Document purpose of propagate_mode for clients. 2021-04-29 08:56:46 -07:00
Alex Dehnert 700eb8eb41 docs: More logically order fields of update_message event.
The order of the fields of the update_message event were previous
seemingly-arbitrary. This tries to more coherently order them:
1. Metadata
2. Stream
3. Topic
4. Content
2021-04-29 08:17:15 -07:00
Alex Dehnert 3045e0a2e4 docs: Clarify message_id vs message_ids in update_message event.
In addition, fix a typo of "sam" instead of "same".
2021-04-29 08:17:15 -07:00
100RABHpy 21be0ef445 openapi: Refactor hacky openAPI curl test.
Fixes #17795

In PR #17014, we added support for deactivate-own-user.
And while doing so, we first deactivated the client and
then reactivated it. But this implementation is a bit
hacky.

So, to fix this, we're now deactivating a test_user so that
we don't have to reactivate it. We did so by changing the value
of authentication_line.

As we want to keep endpoint code out of the
“test_curl_examples”, we changed the value of
authentication_line in `curl_param_value_generators.py`.

To work this out, we create a new global variable named
AUTHENTICATION_LINE in “curl_param_value_generators.py”
and change its value in function “deactivate_own_user” and
to use this change in “test_curl_examples,” we import
AUTHENTICATION_LINE.

AUTHENTICATION_LINE is of list data type because we want a
pointer to original mutable object so that changes made during
run time show across the module. Another way to do this is to change
the way we import variable, but that will be inconsistent to
the way we had in all other files.

To remove confusion between AUTHENTICATION_LINE and
authentication_line we renamed authentication_line
to default_authentication_line.
2021-04-28 15:49:35 -07:00
Tim Abbott 50f00d3e97 emails: Add unsubscribe link infrastructure for marketing emails.
This is intended to be used in any marketing emails that we send with
the send_custom_email infrastructure.
2021-04-27 21:36:09 -07:00