Pēteris Caune
1881fa1da0
Fix tests
2023-09-08 16:54:13 +03:00
Pēteris Caune
ee40cd8dab
Fix type warnings
2023-09-08 16:47:27 +03:00
Pēteris Caune
f1d1ccd281
Add Channel.shell and Channel.pd properties
2023-09-08 16:33:12 +03:00
Pēteris Caune
e17f555fb1
Replace Channel.telegram_* properties with a Channel.telegram property
...
The Channel.telegram property has typed fields:
id, thread_id, type, name.
Usage sites change from `channel.telegram_id` to `channel.telegram.id`
2023-09-08 16:02:26 +03:00
Pēteris Caune
5746bbb015
Improve type hints in hc.api.models
2023-09-08 15:58:39 +03:00
Pēteris Caune
a6ab647a46
Improve type hints in hc.accounts.models
2023-09-08 15:54:47 +03:00
Pēteris Caune
92bf9773dc
Improve type hints in hc.lib
2023-09-08 13:05:19 +03:00
Pēteris Caune
9173475194
Improve type hints in hc.api.views
2023-09-07 14:38:55 +03:00
Pēteris Caune
a2fa62c7be
Improve function and variable names
2023-09-07 14:05:47 +03:00
Pēteris Caune
18aac7f46c
Update Spec model to handle int -> timedelta conversion
2023-09-07 13:19:21 +03:00
Pēteris Caune
53200a0559
Switch to using None as the sentinel object for absent fields
...
It means we need to have an extra checks for null values
in Spec.check_nulls() but it makes mypy more happy.
2023-09-07 12:56:35 +03:00
Pēteris Caune
370a75373b
Combine the "validate_json" and "authorize" decorators
2023-09-07 11:18:14 +03:00
Pēteris Caune
ee30448c0b
Update hc.api.views to use Pydantic for incoming data validation
2023-09-07 10:31:54 +03:00
Pēteris Caune
05d2d0065e
Remove usage of backports.zoneinfo
2023-09-06 12:54:27 +03:00
Pēteris Caune
77e1ea731c
Improve type hints in hc.accounts.views
2023-09-06 12:51:27 +03:00
Pēteris Caune
c9bf3132fe
Replace usage of typing.List, typing.Optional etc. with modern syntax
2023-09-06 11:27:43 +03:00
Pēteris Caune
d79069f669
Fix type warnings, improve type hints in hc.front.views
2023-09-06 11:18:47 +03:00
Pēteris Caune
e9ac841d01
Move reusable type aliases to hc.lib.typealias
2023-09-06 10:52:47 +03:00
Pēteris Caune
3c19d51836
Drop Python 3.8 and Python 3.9 support
2023-09-06 10:31:13 +03:00
Pēteris Caune
65b3acf964
Improve type hints in hc.accounts.views
2023-09-06 10:02:50 +03:00
Pēteris Caune
0c83ca4fd8
Improve type hints in hc.accounts.forms
2023-09-05 18:31:35 +03:00
Pēteris Caune
9153c1a552
Improve type hints
2023-09-05 13:31:59 +03:00
Pēteris Caune
1ccd96a045
Fix type warnings
2023-09-05 11:53:57 +03:00
Pēteris Caune
688191e6d5
Upgrade Django to 4.2.5
2023-09-05 10:45:26 +03:00
Pēteris Caune
8472bd5d1e
Update Channel.webhook_spec to return an object instead of a dict
...
This simplifies type annotations, as object's fields
can be type-annotated easily, and JSON->object parsing can be handled
by Pydantic.
2023-09-03 16:20:22 +03:00
Pēteris Caune
957cd59fc7
Fix type warnings
2023-09-03 15:46:31 +03:00
Pēteris Caune
8fa70dc59c
Fix type warnings
2023-09-03 09:29:44 +03:00
Pēteris Caune
ef3837e7e7
Clean up and improve code comments
2023-09-03 09:29:31 +03:00
Pēteris Caune
2901f03146
Fix type warnings
2023-09-03 09:04:38 +03:00
Pēteris Caune
4a819a8018
Convert Signal.send() to a classmethod
...
This fixes a couple mypy warnings, and also fixes a code smell:
we were doing `Signal(None).send(...)` in a few places,
and can now do `Signal.send(...)` instead.
2023-09-02 18:48:25 +03:00
Pēteris Caune
ec607afbde
Improve test coverage for the Signal transport class
2023-09-02 18:24:14 +03:00
Pēteris Caune
23eadc5e64
Fix type warnings
2023-09-02 17:19:31 +03:00
Pēteris Caune
aecdbfb017
Remove dead code in Channel.webhook_spec
...
The "method_down" and "method_up" fields are always set
in webhook configurations, no point checking them.
2023-09-02 16:54:16 +03:00
Pēteris Caune
9932855745
Fix type annotations
2023-09-02 16:52:46 +03:00
Pēteris Caune
1c0dc52099
Remove debug
2023-09-02 12:58:25 +03:00
Pēteris Caune
6b11e60d9c
Update Signal class to parse signal-cli JSON-RPC messages using pydantic
2023-09-02 12:47:42 +03:00
Pēteris Caune
fcdf8dd60e
Fix type annotations for Py 3.8
2023-09-01 10:07:20 +03:00
Pēteris Caune
3430a8dc92
Combine Telegram.ErrorModel and Telegram.MigrationModel classes
2023-09-01 09:49:37 +03:00
Pēteris Caune
c82b720d04
Update Opsgenie and Zulip transports to use pydantic
2023-09-01 09:39:40 +03:00
Pēteris Caune
cc2b8fa1c2
Use pydantic to validate JSON from Telegram API (experimental)
2023-09-01 09:16:33 +03:00
Pēteris Caune
477f690057
Improve type hints
2023-08-31 14:17:08 +03:00
Pēteris Caune
4affd70822
Fix JSON type aliases for Py 3.8 again
2023-08-31 12:25:18 +03:00
Pēteris Caune
e54d96690f
Remove usage of typing.TypeAlias (not available in Py 3.9)
2023-08-31 12:21:17 +03:00
Pēteris Caune
3311712610
Improve type hints, add reusable JSON type aliases in hc.lib.typealias
2023-08-31 12:17:15 +03:00
Pēteris Caune
6bd25cc52c
Improve type hints in hc.api.transports
2023-08-30 16:08:43 +03:00
Pēteris Caune
e23db5a8fa
Fix "JSONValue" type alias for Py 3.8-3.9, take two
2023-08-30 10:16:22 +03:00
Pēteris Caune
1e8d02385d
Fix "JSONValue" type alias for Py 3.8-3.9
2023-08-30 10:10:38 +03:00
Pēteris Caune
e022c17bed
Improve type hints
2023-08-30 09:57:34 +03:00
Pēteris Caune
ab3dad4ecc
Fix type annotations in tests to use _MonkeyPatchedWSGIResponse
2023-08-29 22:35:51 +03:00
Pēteris Caune
2b73ddde17
Improve type hints
2023-08-29 19:10:27 +03:00