mattermost-mobile-upstream/types/api
Guillermo Vayá 1013adb891 feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability
Client, mapping, and capability layer only — intentionally NOT wired into any
lifecycle/trigger path yet (no coordinator, no workers).

- types/api/drafts.d.ts: add DraftApi (server response) and DraftUpsertRequest
  (POST body) DTOs alongside DraftProps.
- types/api/config.d.ts: add AllowSyncedDrafts to ClientConfig.
- client/rest/base.ts: add draft route helpers (drafts POST, user/team GET,
  channel/thread DELETE).
- client/rest/drafts.ts (+test): ClientDrafts mixin — getDrafts, upsertDraft,
  deleteDraft (channel vs thread by rootId), Connection-Id header on POST/DELETE.
  Mixed into client/rest/index.ts (also drops a pre-existing duplicate
  ClientScheduledPost entry in the .with() list).
- constants/preferences.ts: add ADVANCED_SYNC_DRAFTS ('sync_drafts').
- utils/draft/sync.ts (+test): pure bidirectional normalization. server->mobile
  maps update_at->server_update_at (never local update_at), priority, props
  passthrough, exact file_ids, files from metadata.files; mobile->server sends
  only channel_id/root_id/message/type/props/file_ids/priority and returns null
  for an empty message so it never POSTs. Fail-closed burn-on-read reconstruction
  (durations come from server config, not props; missing/invalid -> no enabled
  borConfig).
- queries/servers/drafts.ts: getIsDraftSyncEnabled / observeIsDraftSyncEnabled —
  enabled when AllowSyncedDrafts==='true' AND sync_drafts pref not 'false'
  (absent = enabled). No server-version gate.

Checks: npm run tsc clean; eslint --quiet clean; 69 focused Jest tests pass
across the new client/sync suites and the scheduled_post/post-handler/drafts
regression neighbors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 11:49:47 +02:00
..
apps.d.ts Add date/datetime field support with timezone features for Apps Forms (#9521) 2026-07-16 08:09:47 -06:00
bots.d.ts MM-35115 [Gekidou] Login flow - Email and Password (#5402) 2021-06-18 00:57:40 -04:00
category.d.ts [Gekidou] Sidebar Categories (Database only) (#5909) 2022-01-31 10:30:10 -03:00
channels.d.ts Add BoardView, PropertyField, PropertyValue WatermelonDB tables (#9708) 2026-06-01 12:46:40 +02:00
client.d.ts [MM-68315] Add autorecovery for database corruptions (#9900) 2026-07-13 18:02:35 +02:00
commands.d.ts [Gekidou] Post input (#5844) 2022-02-03 08:59:15 -03:00
config.d.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
custom_profile_attributes.d.ts [MM-64358] don't save unneeded custom profile attributes (#8971) 2025-07-02 17:49:55 +02:00
drafts.d.ts feat(drafts): Phase 2 — draft sync API DTOs, REST client, normalization, capability 2026-07-24 11:49:47 +02:00
emojis.d.ts [Gekidou] Typings & PostMetadata structure (#5542) 2021-07-15 11:49:02 -04:00
error.d.ts MM-35115 [Gekidou] Login flow - Email and Password (#5402) 2021-06-18 00:57:40 -04:00
files.d.ts feat: support fillewillbedownloaded and sendtoastmessage pluginapi (#9416) 2026-02-16 17:10:25 +01:00
groups.d.ts [Gekidou] Saves groups + group-channel for constrained channels (#6358) 2022-08-01 08:02:15 +10:00
integrations.d.ts Add date/datetime field support with timezone features for Apps Forms (#9521) 2026-07-16 08:09:47 -06:00
license.d.ts MM-68200 About modal updates to show correct SKU and align with web (#9662) 2026-04-16 09:10:41 -04:00
mm_blocks.d.ts Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
plugins.d.ts MM-43300: Calls v2 first cut (#6475) 2022-07-22 15:57:12 -04:00
posts.d.ts [MM-66230] Add AI-generated sparkle indicator to post headers (#9835) 2026-07-14 19:31:02 +00:00
preferences.d.ts Replace lottie loading spinner for activity indicator (#6266) 2022-05-12 12:54:43 -04:00
properties.d.ts MM-68208 Implementing global and channel-level banners on mobile (#9752) 2026-07-08 12:47:01 +03:00
reactions.d.ts [Gekidou] Typings & PostMetadata structure (#5542) 2021-07-15 11:49:02 -04:00
roles.d.ts [Gekidou] Typings & PostMetadata structure (#5542) 2021-07-15 11:49:02 -04:00
scheduled_post.d.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
search.d.ts match desktop search and highlight results (#7445) 2023-07-18 12:17:19 -04:00
session.d.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
slash_command.d.ts [Gekidou] Typings & PostMetadata structure (#5542) 2021-07-15 11:49:02 -04:00
teams.d.ts Add guest invites (#9288) 2025-12-11 17:21:18 +01:00
terms_of_service.d.ts Add terms of service (#6777) 2022-11-24 19:58:56 +01:00
threads.d.ts Ensure no unresolved types in the definition files (#6521) 2022-08-05 14:36:19 +02:00
users.d.ts Update the value for login type (#9329) 2025-12-12 16:26:22 +01:00
websocket.d.ts [MM-67563] Change websocket format for translation update events (#9515) 2026-02-18 16:16:13 +01:00