From b0387898cb42b80fd82261faa57826b64174e42e Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Sun, 28 Jun 2026 17:19:00 +0100 Subject: [PATCH] api types, schema --- bots/api/TYPES.md | 16 ++++++++++++---- bots/src/API/Docs/Types.hs | 2 ++ .../types/typescript/src/types.ts | 11 +++++++---- .../src/simplex_chat/types/_types.py | 10 ++++++---- tests/ChatClient.hs | 1 - tests/PostgresSchemaDump.hs | 4 +++- tests/SchemaDump.hs | 4 +++- 7 files changed, 33 insertions(+), 15 deletions(-) diff --git a/bots/api/TYPES.md b/bots/api/TYPES.md index ef8623ba41..97cee71906 100644 --- a/bots/api/TYPES.md +++ b/bots/api/TYPES.md @@ -176,6 +176,7 @@ This file is generated automatically. - [SecurityCode](#securitycode) - [SimplePreference](#simplepreference) - [SimplexLinkType](#simplexlinktype) +- [SimplexNameClaim](#simplexnameclaim) - [SimplexNameDomain](#simplexnamedomain) - [SimplexNameError](#simplexnameerror) - [SimplexNameInfo](#simplexnameinfo) @@ -2787,9 +2788,8 @@ Unknown: - peerType: [ChatPeerType](#chatpeertype)? - localBadge: [LocalBadge](#localbadge)? - localAlias: string -- contactDomain: [SimplexNameInfo](#simplexnameinfo)? +- simplexName: [SimplexNameClaim](#simplexnameclaim)? - contactDomainVerification: bool? -- contactDomainProof: [NameClaimProof](#nameclaimproof)? --- @@ -3162,8 +3162,7 @@ count= - preferences: [Preferences](#preferences)? - peerType: [ChatPeerType](#chatpeertype)? - badge: [BadgeProof](#badgeproof)? -- contactDomain: string? -- contactDomainProof: [NameClaimProof](#nameclaimproof)? +- simplexName: [SimplexNameClaim](#simplexnameclaim)? --- @@ -3609,6 +3608,15 @@ A_QUEUE: - "relay" +--- + +## SimplexNameClaim + +**Record type**: +- name: [SimplexNameInfo](#simplexnameinfo) +- proof: [NameClaimProof](#nameclaimproof)? + + --- ## SimplexNameDomain diff --git a/bots/src/API/Docs/Types.hs b/bots/src/API/Docs/Types.hs index c975859013..58734f7b29 100644 --- a/bots/src/API/Docs/Types.hs +++ b/bots/src/API/Docs/Types.hs @@ -358,6 +358,7 @@ chatTypesDocsData = (sti @SecurityCode, STRecord, "", [], "", ""), (sti @SimplePreference, STRecord, "", [], "", ""), (sti @SimplexLinkType, STEnum, "XL", [], "", ""), + (sti @SimplexNameClaim, STRecord, "", [], "", ""), (sti @SimplexNameDomain, STRecord, "", [], "", ""), (sti @SimplexNameError, STUnion, "SNE", [], "", ""), (sti @SimplexNameInfo, STRecord, "", [], "", ""), @@ -587,6 +588,7 @@ deriving instance Generic RelayStatus deriving instance Generic ReportReason deriving instance Generic SecurityCode deriving instance Generic SimplexLinkType +deriving instance Generic SimplexNameClaim deriving instance Generic SimplexNameDomain deriving instance Generic SimplexNameError deriving instance Generic SimplexNameInfo diff --git a/packages/simplex-chat-client/types/typescript/src/types.ts b/packages/simplex-chat-client/types/typescript/src/types.ts index e11f494288..d62b039334 100644 --- a/packages/simplex-chat-client/types/typescript/src/types.ts +++ b/packages/simplex-chat-client/types/typescript/src/types.ts @@ -3027,9 +3027,8 @@ export interface LocalProfile { peerType?: ChatPeerType localBadge?: LocalBadge localAlias: string - contactDomain?: SimplexNameInfo + simplexName?: SimplexNameClaim contactDomainVerification?: boolean - contactDomainProof?: NameClaimProof } export enum MemberCriteria { @@ -3410,8 +3409,7 @@ export interface Profile { preferences?: Preferences peerType?: ChatPeerType badge?: BadgeProof - contactDomain?: string - contactDomainProof?: NameClaimProof + simplexName?: SimplexNameClaim } export type ProxyClientError = @@ -3984,6 +3982,11 @@ export enum SimplexLinkType { Relay = "relay", } +export interface SimplexNameClaim { + name: SimplexNameInfo + proof?: NameClaimProof +} + export interface SimplexNameDomain { nameTLD: SimplexTLD domain: string diff --git a/packages/simplex-chat-python/src/simplex_chat/types/_types.py b/packages/simplex-chat-python/src/simplex_chat/types/_types.py index f17098b4f6..1edc7e8a02 100644 --- a/packages/simplex-chat-python/src/simplex_chat/types/_types.py +++ b/packages/simplex-chat-python/src/simplex_chat/types/_types.py @@ -2119,9 +2119,8 @@ class LocalProfile(TypedDict): peerType: NotRequired["ChatPeerType"] localBadge: NotRequired["LocalBadge"] localAlias: str - contactDomain: NotRequired["SimplexNameInfo"] + simplexName: NotRequired["SimplexNameClaim"] contactDomainVerification: NotRequired[bool] - contactDomainProof: NotRequired["NameClaimProof"] MemberCriteria = Literal["all"] @@ -2392,8 +2391,7 @@ class Profile(TypedDict): preferences: NotRequired["Preferences"] peerType: NotRequired["ChatPeerType"] badge: NotRequired["BadgeProof"] - contactDomain: NotRequired[str] - contactDomainProof: NotRequired["NameClaimProof"] + simplexName: NotRequired["SimplexNameClaim"] class ProxyClientError_protocolError(TypedDict): type: Literal["protocolError"] @@ -2781,6 +2779,10 @@ class SimplePreference(TypedDict): SimplexLinkType = Literal["contact", "invitation", "group", "channel", "relay"] +class SimplexNameClaim(TypedDict): + name: "SimplexNameInfo" + proof: NotRequired["NameClaimProof"] + class SimplexNameDomain(TypedDict): nameTLD: "SimplexTLD" domain: str diff --git a/tests/ChatClient.hs b/tests/ChatClient.hs index 234b0d1a1a..6304b22f72 100644 --- a/tests/ChatClient.hs +++ b/tests/ChatClient.hs @@ -57,7 +57,6 @@ import Simplex.Messaging.Client (ProtocolClientConfig (..)) import Simplex.Messaging.Client.Agent (defaultSMPClientAgentConfig) import Simplex.Messaging.Crypto.Ratchet (supportedE2EEncryptVRange) import qualified Simplex.Messaging.Crypto.Ratchet as CR -import Simplex.Messaging.Protocol (sndAuthKeySMPClientVersion) import Simplex.Messaging.Server (runSMPServerBlocking) import Simplex.Messaging.Server.Env.STM (ServerConfig (..), ServerStoreCfg (..), StartOptions (..), StorePaths (..), defaultMessageExpiration, defaultIdleQueueInterval, defaultNtfExpiration, defaultInactiveClientExpiration) import Simplex.Messaging.Server.MsgStore.STM (STMMsgStore) diff --git a/tests/PostgresSchemaDump.hs b/tests/PostgresSchemaDump.hs index 0cd79ac513..b36b7faeaf 100644 --- a/tests/PostgresSchemaDump.hs +++ b/tests/PostgresSchemaDump.hs @@ -80,5 +80,7 @@ skipComparisonForDownMigrations = -- group_member_intro_id field moves "20251128_migrate_member_relations", -- on down migration single_sender_group_member_id column is re-added at the end of the table - "20260529_delivery_job_senders" + "20260529_delivery_job_senders", + -- group_domain is removed + "20260603_simplex_name" ] diff --git a/tests/SchemaDump.hs b/tests/SchemaDump.hs index 2336fd56dd..783f6587bf 100644 --- a/tests/SchemaDump.hs +++ b/tests/SchemaDump.hs @@ -145,7 +145,9 @@ skipComparisonForDownMigrations = -- on down migration single_sender_group_member_id column and its index -- are re-added at the end of the table / file (ALTER TABLE ADD COLUMN -- appends; CREATE INDEX appends). - "20260529_delivery_job_senders" + "20260529_delivery_job_senders", + -- group_domain is removed + "20260603_simplex_name" ] getSchema :: FilePath -> FilePath -> IO String