Commit graph

228 commits

Author SHA1 Message Date
Yago González 292a3bc067 api: Add execution permissions to welcome-message. 2018-05-14 11:04:57 -07:00
Yago González 817636cbc6 api: Implement /users/me/<stream_id>/topics. 2018-05-14 11:04:57 -07:00
Joshua Pan 33e8352998 requirements: Add 'security' extra_require for requests.
There were some issues running bots due to SSL issues.
Adding the extra_require requests[security] adds 3
additional packages that deal with these issues.
2018-05-14 04:28:53 -07:00
rht e56a94c853 Dig a tunnel to matrix. 2018-05-07 09:07:36 -07:00
neiljp (Neil Pilgrim) 55d75b11bc packaging: Add py.typed marker file & install in setup.py.
This follows the provisional new PEP 561:
https://www.python.org/dev/peps/pep-0561/.
2018-05-02 12:13:26 -07:00
Eeshan Garg f4bdb059db pypi: Release version 0.4.6.
This includes a critical bug fix for call_on_each_event.
2018-04-27 01:43:42 -02:30
Tim Abbott d40328a311 api: Fix call_on_each_events handling of empty event_types.
The root issue here is that we had been using `None` as a way of
encoding `event_types` as being an argument to not pass to the server
in the API codebase, but the marshalling to send this over the wire
didn't handle that possibility correctly.

This was incorrectly "fixed" in
409bb587429ec4dcb1220a8ed85ec1618ffde0ed; the root cause of the issue
was the refactor to the new approach for registering API endpoints.
2018-04-25 23:01:37 -07:00
Eeshan Garg 0f448579ab pypi: Release 0.4.5.
We just made a minor change to our Git integration, so that warranted
a new release so I could update the docs on the zulip/zulip repo.
2018-04-23 18:50:56 -02:30
Eeshan Garg 5f20512601 integrations/git: Allow users to specify a stream for notifications.
Previously, all notifications went to "commits", now users can
modify the constant at the top to change that.
2018-04-23 18:38:16 -02:30
Eeshan Garg 2d46445ab5 pypi: Release version 0.4.4.
This includes some important changes after the release of pip 10.
2018-04-16 17:05:27 -02:30
neiljp (Neil Pilgrim) 55aff6f64b mypy: Improve typing of bots & API; enforce no_implicit_optional. 2018-04-06 13:45:11 -04:00
Eeshan Garg 60e02ed979 pypi: Release version 0.4.3.
Making this release due to recent changes made to the Trello script.
2018-04-03 22:05:39 -02:30
Eeshan Garg fa759fc97c integrations/trello: Improve the Trello script.
This commit makes a bunch of improvements:

1. Use format() for string formatting instead of the old style.
2. Stop returning stuff where we don't have to.
3. URL generation should not be done by the script, especially
   since our eventual goal is for the Zulip server to automatically
   generate a webhook URL. So the user should be able to supply
   the URL in the config file. Plus, this makes it easier to test
   the script with non-Zulip URLs (such as RequestBin).
4. Removed unnecessary arguments.
2018-04-03 21:52:10 -02:30
neiljp (Neil Pilgrim) 0f29e9f71b mypy: Improve type annotations in Zulip API.
- Reduce use of Any, eg. in Callable parameters & narrow List;
- Use Optional where appropriate in more locations.
2018-03-31 15:45:54 -07:00
neiljp (Neil Pilgrim) 83b41a2e9e zulip: Amend default value of remove_subscriptions:principals to None.
Having a default parameter as '[]' may not be an issue with the current
implementation, but general practice is to default to None and assign
a default list subsequently.
2018-03-31 15:45:25 -07:00
Eeshan Garg 7e360c244c pypa: Release version 0.4.2. 2018-03-31 17:19:23 -02:30
amanagr aa5df127ae API: Use session.headers.update method to add user-agent header.
Directly assigning session.headers overrides the default header
paramers and removes `{'Accept-Encoding': 'gzip, deflate'}` from
the headers.
2018-03-30 13:10:04 -07:00
JazZ 2f4b276799 Add Trello integration script
This is a small Python script to create Trello Webhooks for Zulip.

It builds and sends the Trello API requests required to create the
Trello webhook.
2018-03-29 15:24:14 -04:00
Shivam Gera fc1d134685 api: Use custom exceptions in API client.
This removes the use of RuntimeError, and replaces it with a custom
error class called ZulipError.  In a few places, we use a subclass to
make it easier for code to interact with the error type.
2018-02-16 11:33:18 -08:00
Eeshan Garg f74c94ba04 pypi_packaging: Release version 0.4.1. 2018-02-07 01:03:49 -03:30
XavierCooney 68ec3a5ef0 zephyr_mirror_backend.py: Remove duplicate import. 2018-01-16 08:07:09 -05:00
Eeshan Garg 67cdb6f8f0 zulip: Make a DELETE request in remove_subscriptions.
Previously, remove_subscriptions called the
PATCH /api/v1/users/me/subscriptions endpoint, which is more like
an ad-hoc endpoint for bulk adding/removing subscriptions for the
user that makes the request. However, making a DELETE request
allows an admin to pass in the `principals` argument to unsubscribe
other users from streams as well, which is more consistent with how
add_subscriptions works.
2018-01-12 07:29:06 -05:00
Eeshan Garg 4458276801 requirements: Remove runtime dependency on mock.
The zulip and zulip_botserver packages specify mock as a runtime
dependency, which is only needed for testing during development.
So, it made more sense to move it to requirements.txt so that
it can be installed by ./tools/provision during development.
2018-01-09 17:01:16 -03:30
neiljp (Neil Pilgrim) d3220eefe7 Jabber: Report where Zulip config not found, clarifying typing. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) b5c3442b57 mypy: Remove explicit typing & add assertions in jabber backend.
Usage indicates set_jabber_client must be called before using
JabberToZulipBot, so assertions express intent & satisfy mypy.
2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) afee6d706f mypy: Assert Zulip.[api_key|email] are not None, satisfying use in Zephyr. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) aa718da3e1 Zephyr: For correctness & mypy, res.get('result') -> res['result'].
Also correct nearby error message (subscribing to -> receiving).
2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 02d9ba8edd mypy: Add cast for zephyr_mirror_backend logger variable. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 466f5a7167 mypy: Amend zephyr mirror annotations for strict-optional. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 2b172e08c7 mypy: Correct SVN integration & satisfy strict-optional typing.
The commit_notice_destination return value was previously not
checked against None, which indicates no message should be sent.
2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 9502e0eb9a hg integration: Use explicit sys.exit. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 55df1886cc mypy: Amend hg integration to simplify error handling/typing. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) d26e44ebb2 mypy: Add client_cert assertion & amend annotation in Zulip API. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 13bf6f7262 mypy: Add non-None session assertion in Zulip API. 2018-01-08 15:39:03 -05:00
neiljp (Neil Pilgrim) 2a2c8ae25f API: Amend call_on_each_event error handling to not use .get().
mypy with strict-optional led to examination of res.get('result')
calls potentially raising TypeError ('error' in None).

Server code indicates this is safe, and other nearby code assumes
presence of fields in 'res' also.
2018-01-08 15:39:03 -05:00
Eeshan Garg 3030c73060 packages: Release 0.4.0. 2018-01-06 18:28:35 -03:30
Robert Hönig 06c5904347 Add 'mock' requirement for zulip and zulip_botserver.
These packages depend on mock. Previously, that dependency
was satisfied "by chance" because zulip_bots happened to
install 'mock'.
2018-01-06 16:39:52 +01:00
neiljp (Neil Pilgrim) 8b4e877546 mypy: Amend upload-file example, to pass with strict-optional. 2018-01-02 14:05:33 -05:00
neiljp (Neil Pilgrim) 9df922e7fa mypy: Adjust zulip api slightly, to pass with strict-optional. 2018-01-02 14:05:33 -05:00
neiljp (Neil Pilgrim) fc460dc12b mypy: Rewrite trac integration for clarity & to pass strict-optional. 2018-01-02 14:05:33 -05:00
neiljp (Neil Pilgrim) 33ccc04a32 mypy: Amend code & typing of integrations, to pass with strict-optional. 2018-01-02 14:05:33 -05:00
Rhea Parekh 27842b2d24 slack importer: Add README.md. 2017-12-27 07:54:42 -05:00
Rhea Parekh 0bb50fdc4e slack importer: Shift the slack data conversion files to zulip server repo. 2017-12-27 07:54:42 -05:00
neiljp (Neil Pilgrim) bcca5230a3 mypy: Remove un-needed 'type: ignore' for session.auth. 2017-12-21 18:43:42 -05:00
fredfishgames b865978546 Create welcome-message api example. 2017-12-19 14:42:55 -05:00
neiljp (Neil Pilgrim) 28687f18ca mypy: Add --disallow-any=generics & extend typing accordingly.
Also reset typing of ExternalBotHandler to Any after discussion.
2017-12-11 20:14:00 -06:00
Rhea Parekh e5726fdc96 slack: fix type annonations. 2017-12-03 10:30:02 -08:00
Rhea Parekh 1f17c04115 slack: remove the messages and attachments mapping. 2017-12-03 10:30:02 -08:00
Rhea Parekh 455acb8e3b slack: Make minor fixes in zerver_userprofile and zerver_realm mappings. 2017-12-03 10:30:02 -08:00
Rhea Parekh 8def7564dd slack: Map recipients and subscriptions for private messages. 2017-12-03 10:30:02 -08:00