Junyao Chen
7140149373
ts: Migrate bot_data.js to TypeScript.
...
Add type annotations. Create custom types for Bot and Service.
Add zod data validation for incoming bot data from server.
Based on `zerver/openapi/zulip.yaml` description, `add` operation
(`op`) carries data that follows `Bot` structure. So taking
reference from `bot` structure, I create `ServerAddBotData` zod
schema and infer its type. Similarly, `update` operation carries
data that follows `BasicBot`, so I create `ServerUpdateBotData`.
Note that `Bot` inherits from `BasicBot`.
`zerver/openapi/zulip.yaml` describes that `services` in `BasicBot`
can be one of two objects, one with `{base_url, token, interface}`,
another with `{service_name, config_data}`. Therefore, I create
two corresponding schema and infer their types.
Fix two test cases `bot_data.test.js` and `settings_bots.test.js`
whose synthetic objects should have had followed the schema.
2023-08-14 16:06:15 -07:00
..
2023-08-06 18:06:42 -07:00
2023-07-02 16:16:38 -07:00
2023-07-17 11:31:51 -07:00
2023-07-19 16:18:31 -07:00
2023-06-23 11:42:29 -07:00
2023-08-14 16:06:15 -07:00
2023-05-26 16:28:45 -07:00
2023-07-02 16:57:16 -07:00
2023-05-09 13:16:28 -07:00
2023-07-19 16:18:31 -07:00
2023-08-14 16:00:20 -07:00
2023-03-02 12:16:56 -08:00
2023-08-07 17:08:59 -07:00
2023-05-03 18:40:59 -07:00
2023-08-07 17:08:59 -07:00
2023-08-04 18:00:38 -07:00
2023-08-07 17:08:59 -07:00
2023-08-07 17:08:59 -07:00
2023-08-07 17:08:59 -07:00
2023-08-04 18:00:38 -07:00
2023-08-07 17:08:59 -07:00
2023-08-07 17:08:59 -07:00
2023-08-09 15:35:14 -07:00
2023-08-07 17:08:59 -07:00
2023-08-09 14:38:52 -07:00
2023-08-11 15:54:17 -07:00
2023-07-11 22:33:59 -07:00
2023-06-05 21:51:26 -07:00
2023-04-05 10:29:01 -07:00
2023-06-23 11:42:29 -07:00
2023-03-12 15:17:53 -07:00
2023-08-07 17:08:59 -07:00
2023-03-02 13:26:20 -08:00
2023-03-31 10:41:06 -07:00
2023-06-05 21:57:35 -07:00
2023-07-02 16:16:38 -07:00
2023-05-14 11:24:31 -07:00
2023-07-21 13:10:07 -07:00
2023-03-02 12:16:56 -08:00
2023-07-12 07:09:03 -07:00
2023-07-24 13:02:28 -07:00
2023-07-17 17:39:17 -07:00
2023-05-16 12:36:29 -07:00
2023-04-25 09:09:48 -07:00
2023-07-24 13:02:28 -07:00
2023-05-09 13:16:28 -07:00
2023-05-09 13:16:28 -07:00
2023-07-17 11:31:51 -07:00
2023-04-19 12:20:49 -07:00
2023-07-17 09:39:24 -07:00
2023-06-26 11:07:28 -07:00
2023-06-26 10:59:53 -07:00
2023-06-05 21:57:35 -07:00
2023-07-24 13:02:28 -07:00
2023-06-26 11:07:28 -07:00
2023-08-07 17:08:59 -07:00
2023-07-02 16:57:16 -07:00
2023-02-26 17:43:47 -08:00
2023-08-04 18:00:38 -07:00
2023-05-03 18:40:59 -07:00
2023-08-07 17:08:59 -07:00
2023-04-25 09:07:08 -07:00
2023-08-07 17:08:59 -07:00
2023-08-04 18:00:38 -07:00
2023-08-04 18:00:38 -07:00
2023-07-17 10:37:29 -07:00
2023-07-11 22:22:30 -07:00
2023-07-11 22:22:30 -07:00
2023-03-02 12:16:56 -08:00
2023-06-26 11:07:28 -07:00
2023-06-26 11:07:28 -07:00
2023-07-13 14:01:32 -07:00
2023-08-04 18:00:38 -07:00
2023-07-19 16:18:31 -07:00
2023-07-24 17:40:59 -07:00
2023-06-26 11:07:28 -07:00
2023-08-04 14:38:37 -07:00
2023-08-04 18:00:38 -07:00
2023-05-10 17:06:59 -07:00
2023-04-26 12:59:08 -07:00
2023-08-07 17:08:59 -07:00
2023-07-11 22:34:00 -07:00
2023-06-27 18:04:04 -07:00
2023-08-14 16:06:15 -07:00
2023-06-13 18:01:41 -07:00
2023-07-17 11:31:51 -07:00
2023-07-27 14:10:08 -07:00
2023-07-02 16:16:38 -07:00
2023-08-04 18:00:38 -07:00
2023-08-06 13:55:21 -07:00
2023-07-24 13:02:28 -07:00
2023-08-07 17:08:59 -07:00
2023-07-25 18:33:04 -07:00
2023-04-25 10:05:59 -07:00
2023-08-04 14:38:37 -07:00
2023-07-25 18:33:04 -07:00
2023-03-27 10:07:41 -07:00
2023-04-30 22:39:52 -07:00
2023-08-04 18:00:38 -07:00
2023-05-01 21:13:53 -07:00
2023-05-09 13:16:28 -07:00
2023-08-07 17:08:59 -07:00
2023-03-03 12:04:42 -08:00
2023-07-02 16:16:38 -07:00
2023-08-04 18:00:38 -07:00
2023-05-05 16:27:03 -07:00
2023-06-23 11:42:29 -07:00
2023-07-06 17:48:22 -07:00
2023-07-02 16:57:16 -07:00
2023-07-17 10:38:24 -07:00
2023-07-27 14:10:08 -07:00
2023-07-17 17:39:17 -07:00
2023-04-10 10:26:48 -07:00
2023-03-02 12:16:56 -08:00