@@ -48,6 +48,9 @@ import {
4848 RegisterDeviceRequest ,
4949 RegisterDeviceResponse ,
5050 UnregisterDeviceResponse ,
51+ GetNotificationPreferencesResponse ,
52+ UpdateNotificationPreferencesRequest ,
53+ UpdateNotificationPreferencesResponse ,
5154 ListNotificationsResponse ,
5255 MarkNotificationsReadResponse ,
5356 MarkAllNotificationsReadResponse ,
@@ -899,22 +902,22 @@ export class ObjectStackClient {
899902 /**
900903 * Get notification preferences for the current user
901904 */
902- getPreferences : async ( ) => {
905+ getPreferences : async ( ) : Promise < GetNotificationPreferencesResponse > => {
903906 const route = this . getRoute ( 'notifications' ) ;
904907 const res = await this . fetch ( `${ this . baseUrl } ${ route } /preferences` ) ;
905- return this . unwrapResponse ( res ) ;
908+ return this . unwrapResponse < GetNotificationPreferencesResponse > ( res ) ;
906909 } ,
907910
908911 /**
909912 * Update notification preferences
910913 */
911- updatePreferences : async ( preferences : Record < string , any > ) => {
914+ updatePreferences : async ( preferences : UpdateNotificationPreferencesRequest [ 'preferences' ] ) : Promise < UpdateNotificationPreferencesResponse > => {
912915 const route = this . getRoute ( 'notifications' ) ;
913916 const res = await this . fetch ( `${ this . baseUrl } ${ route } /preferences` , {
914917 method : 'PUT' ,
915918 body : JSON . stringify ( { preferences } )
916919 } ) ;
917- return this . unwrapResponse ( res ) ;
920+ return this . unwrapResponse < UpdateNotificationPreferencesResponse > ( res ) ;
918921 } ,
919922
920923 /**
0 commit comments