diff --git a/lib/types/request-types.js b/lib/types/request-types.js --- a/lib/types/request-types.js +++ b/lib/types/request-types.js @@ -42,6 +42,7 @@ INITIAL_ACTIVITY_UPDATES: 7, MORE_ONE_TIME_KEYS: 8, SIGNED_IDENTITY_KEYS_BLOB: 9, + INITIAL_NOTIFICATIONS_ENCRYPTED_MESSAGE: 10, }); type ServerRequestType = $Values; export function assertServerRequestType( @@ -55,7 +56,8 @@ serverRequestType === 6 || serverRequestType === 7 || serverRequestType === 8 || - serverRequestType === 9, + serverRequestType === 9 || + serverRequestType === 10, 'number is not ServerRequestType enum', ); return serverRequestType; @@ -175,12 +177,26 @@ +signedIdentityKeysBlob: SignedIdentityKeysBlob, }; +type InitialNotificationsEncryptedMessageServerRequest = { + +type: 10, +}; +const initialNotificationsEncryptedMessageServerRequestValidator = + tShape({ + type: tNumber(serverRequestTypes.INITIAL_NOTIFICATIONS_ENCRYPTED_MESSAGE), + }); + +type InitialNotificationsEncryptedMessageClientResponse = { + +type: 10, + +initialNotificationsEncryptedMessage: string, +}; + export type ServerServerRequest = | PlatformServerRequest | PlatformDetailsServerRequest | ServerCheckStateServerRequest | MoreOneTimeKeysServerRequest - | SignedIdentityKeysBlobServerRequest; + | SignedIdentityKeysBlobServerRequest + | InitialNotificationsEncryptedMessageServerRequest; export const serverServerRequestValidator: TUnion = t.union([ platformServerRequestValidator, @@ -188,6 +204,7 @@ serverCheckStateServerRequestValidator, moreOneTimeKeysServerRequestValidator, signedIdentityKeysBlobServerRequestValidator, + initialNotificationsEncryptedMessageServerRequestValidator, ]); export type ClientResponse = @@ -198,7 +215,8 @@ | CheckStateClientResponse | InitialActivityUpdatesClientResponse | MoreOneTimeKeysClientResponse - | SignedIdentityKeysBlobClientResponse; + | SignedIdentityKeysBlobClientResponse + | InitialNotificationsEncryptedMessageClientResponse; export type ClientCheckStateServerRequest = { +type: 6, @@ -223,7 +241,8 @@ | PlatformDetailsServerRequest | ClientCheckStateServerRequest | MoreOneTimeKeysServerRequest - | SignedIdentityKeysBlobServerRequest; + | SignedIdentityKeysBlobServerRequest + | InitialNotificationsEncryptedMessageServerRequest; // This is just the client variant of ClientResponse. The server needs to handle // multiple client versions so the type supports old versions of certain client @@ -244,7 +263,8 @@ | CheckStateClientResponse | InitialActivityUpdatesClientResponse | MoreOneTimeKeysClientResponse - | SignedIdentityKeysBlobClientResponse; + | SignedIdentityKeysBlobClientResponse + | InitialNotificationsEncryptedMessageClientResponse; export type ClientInconsistencyResponse = | ClientThreadInconsistencyClientResponse