zulip/zerver/lib
Steve Howell 69517f5ac5 Support zform-based widget content in the server.
API users, particularly bots, can now send a field
called "widget_content" that will be turned into
a submessage for the web app to look at.  (Other
clients can still rely on "content" to be there,
although it's up to the bot author to make the
experience good for those clients as well.)

Right now widget_content will be a JSON string that
encodes a "zform" widget with "choices."  Our first
example will be a trivia bot, where users will see
something like this:

    Which fruit is orange in color?

        [A] orange
        [B] blackberry
        [C] strawberry

The letters will be turned into buttons on the webapp
and have canned replies.

This commit has a few parts:
    - receive widget_content in the request (simply
        validating that it's a string)
    - parse the JSON in check_message and deeply
        validate its structure
    - turn it into a submessage in widget.py
2018-05-24 09:30:22 -07:00
..
bugdown mypy: Enable strict optional in zerver/lib/bugdown. 2018-05-17 11:12:01 -07:00
url_preview url_preview: Fix crash when description has no content. 2018-05-17 12:40:43 -07:00
webhooks webhooks: Add generic exception for unexpected webhook events. 2018-05-22 08:30:19 -07:00
__init__.py
actions.py Support zform-based widget content in the server. 2018-05-24 09:30:22 -07:00
addressee.py address: Remove dead msg_type function. 2018-05-13 17:47:21 -07:00
alert_words.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
api_test_helpers.py pypi packaging: Upgrade to release 0.4.6. 2018-04-27 14:50:25 -07:00
attachments.py zerver/lib: Use python 3 syntax for typing. 2017-11-21 20:56:40 -08:00
avatar.py mypy: Enable strict optional in lib/avatar.py. 2018-05-17 11:11:55 -07:00
avatar_hash.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
bot_config.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
bot_lib.py embedded bots: Use get_active_user helper to look up users. 2018-05-20 20:04:16 -07:00
bot_storage.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
bulk_create.py populate_db: Make is_web_public default to False. 2018-05-16 13:40:22 -07:00
cache.py events: Add date_joined to user_dict. 2018-05-17 07:49:35 -07:00
cache_helpers.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
camo.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
ccache.py str_utils: Move force_bytes into ccache.py. 2018-05-15 19:07:32 -07:00
context_managers.py zerver/lib: Use python 3 syntax for typing. 2017-11-21 20:45:52 -08:00
create_user.py mypy: Fix rebase errors in create_user.py. 2018-05-23 11:36:28 -07:00
db.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
debug.py mypy: Set local_partial_types = True. 2018-05-21 22:41:00 -07:00
digest.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
domains.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
email_mirror.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
emoji.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
error_notify.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
events.py mypy: Enable strict optional in lib/events. 2018-05-17 11:11:53 -07:00
exceptions.py webhooks: Add generic exception for unexpected webhook events. 2018-05-22 08:30:19 -07:00
export.py export: Support export of Custom Profile Field. 2018-05-23 09:07:26 -07:00
feedback.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
fix_unreads.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
generate_test_data.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
hotspots.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
html_diff.py mypy: Remove type: ignores that are unnecessary with new mypy. 2017-11-25 10:06:28 -08:00
i18n.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
import_realm.py export: Support export of Custom Profile Field. 2018-05-23 09:07:26 -07:00
initial_password.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
integrations.py integrations: Update docs for git and codebase. 2018-05-15 18:02:56 -04:00
json_encoder_for_html.py mypy: Fix annotations for json_encoder_for_html. 2017-11-22 01:32:46 -08:00
logging_util.py settings: Fix double negative in LOGGING_NOT_DISABLED. 2018-03-21 18:03:05 -07:00
management.py tests: Reach 100% coverage for zerver/liv/management.py. 2018-05-14 10:46:21 -07:00
mdiff.py mypy: Amend diff_strings to return str or raise DiffException. 2018-02-13 11:40:51 -08:00
mention.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
message.py mypy: enable strict optional for lib/message. 2018-05-17 11:12:08 -07:00
migrate.py migrate: Remove obsolete act_on_message_ranges. 2018-05-15 17:19:14 -07:00
mobile_auth_otp.py zerver/lib/mobile_auth_otp: Sweep force_str. 2017-12-26 09:09:31 -05:00
name_restrictions.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
narrow.py narrow: Add is_web_public_compatible check for narrows. 2018-05-21 08:45:48 -07:00
notifications.py notifications: Add consistent order for sending email notifications. 2018-05-20 10:19:13 -07:00
onboarding.py create_realm_internal_bots: Refactor to extract main op as a function. 2018-05-23 11:53:22 +05:30
outgoing_webhook.py outgoing_webhook.py: Fix incorrect variable type. 2018-05-23 08:57:56 -07:00
parallel.py zerver/lib: Use python 3 syntax for typing. 2017-11-18 16:09:04 -08:00
profile.py
push_notifications.py push_notifications: Fix missing mypy annotation. 2018-05-21 11:39:58 -07:00
queue.py mypy: Remove some now-unnecessary type: ignores. 2018-03-28 10:39:05 -07:00
rate_limiter.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
realm_icon.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
redis_utils.py zerver/lib: Use python 3 syntax for typing. 2017-11-18 16:09:04 -08:00
request.py request: Add new str_validator validator type. 2018-05-03 21:11:02 -07:00
request.pyi request.pyi: Remove unused import of typing.Text. 2018-05-14 05:16:22 +05:30
response.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
rest.py uploads: Add new way of querying for mobile uploads endpoint. 2018-04-13 17:51:45 -07:00
retention.py zerver/lib: Use python 3 syntax for typing. 2017-11-28 17:15:14 -08:00
send_email.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
sessions.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
slack_data_to_zulip_data.py i18n: Add missing strings for custom profile fields and fix capitalization. 2018-05-06 19:44:36 -07:00
slack_message_conversion.py Slack importer: Map Slack channel mentions to Zulip stream mentions. 2018-04-09 10:47:39 -07:00
soft_deactivation.py mypy: Enable strict optional on lib/soft_deactivation. 2018-05-17 12:13:53 -07:00
sqlalchemy_utils.py mypy: Set local_partial_types = True. 2018-05-21 22:41:00 -07:00
statistics.py zerver/lib: Use Python 3 syntax for typing for several files. 2017-11-28 17:02:24 -08:00
str_utils.py models: Remove unused ModelReprMixin class. 2018-05-15 19:11:22 -07:00
stream_recipient.py zerver/lib: Use python 3 syntax for typing. 2017-11-18 16:09:04 -08:00
stream_subscription.py Mypy: Use models.py QuerySet annotation approach in stream_subscription.py. 2018-03-15 12:54:43 -07:00
stream_topic.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
streams.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
subdomains.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
test_classes.py 2FA: Add tests for two-factor auth. 2018-05-23 15:49:35 -07:00
test_data.source.txt
test_fixtures.py test_fixtures.py: Add check_settings to is_template_database_current. 2018-05-23 11:53:20 +05:30
test_helpers.py test_helpers: Add use_db_models decorator. 2018-05-21 09:46:24 -07:00
test_runner.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
tex.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
timeout.py mypy: Add assertion in timeout.py. 2018-04-25 08:58:55 -07:00
timestamp.py zerver/lib: Use python 3 syntax for typing. 2017-11-18 16:09:04 -08:00
timezone.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
topic_mutes.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
type_debug.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
types.py profile: Add choice field. 2018-04-26 00:35:51 -07:00
unminify.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
upload.py zerver/tests: Require 100% test coverage of zerver/lib/upload.py. 2018-05-15 10:52:20 -07:00
user_agent.py tests: Move zerver/fixtures to zerver/tests/fixtures for clarity. 2018-04-19 21:50:17 -07:00
user_groups.py zerver/lib: Change use of typing.Text to str. 2018-05-10 14:19:49 -07:00
users.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
utils.py zerver/lib: Change use of typing.Text to str. 2018-05-12 15:22:39 -07:00
validator.py Support zform-based widget content in the server. 2018-05-24 09:30:22 -07:00
widget.py Support zform-based widget content in the server. 2018-05-24 09:30:22 -07:00