1- import { RNIterableAPI } from '../../api' ;
2- import { Iterable } from '../../core/classes/Iterable' ;
1+ import { IterableApi } from '../../core/classes/IterableApi' ;
32import {
43 IterableHtmlInAppContent ,
54 IterableInAppDeleteSource ,
@@ -94,11 +93,7 @@ export class IterableInboxDataModel {
9493 * @returns A promise that resolves to the HTML content of the specified message.
9594 */
9695 getHtmlContentForMessageId ( id : string ) : Promise < IterableHtmlInAppContent > {
97- Iterable ?. logger ?. log (
98- 'IterableInboxDataModel.getHtmlContentForItem messageId: ' + id
99- ) ;
100-
101- return RNIterableAPI . getHtmlInAppContentForMessage ( id ) . then (
96+ return IterableApi . getHtmlInAppContentForMessage ( id ) . then (
10297 ( content : IterableHtmlInAppContentRaw ) => {
10398 return IterableHtmlInAppContent . fromDict ( content ) ;
10499 }
@@ -111,9 +106,7 @@ export class IterableInboxDataModel {
111106 * @param id - The unique identifier of the message to be marked as read.
112107 */
113108 setMessageAsRead ( id : string ) {
114- Iterable ?. logger ?. log ( 'IterableInboxDataModel.setMessageAsRead' ) ;
115-
116- RNIterableAPI . setReadForMessage ( id , true ) ;
109+ return IterableApi . setReadForMessage ( id , true ) ;
117110 }
118111
119112 /**
@@ -123,9 +116,11 @@ export class IterableInboxDataModel {
123116 * @param deleteSource - The source from which the delete action is initiated.
124117 */
125118 deleteItemById ( id : string , deleteSource : IterableInAppDeleteSource ) {
126- Iterable ?. logger ?. log ( 'IterableInboxDataModel.deleteItemById' ) ;
127-
128- RNIterableAPI . removeMessage ( id , IterableInAppLocation . inbox , deleteSource ) ;
119+ return IterableApi . removeMessage (
120+ id ,
121+ IterableInAppLocation . inbox ,
122+ deleteSource
123+ ) ;
129124 }
130125
131126 /**
@@ -135,7 +130,7 @@ export class IterableInboxDataModel {
135130 * If the fetch operation fails, the promise resolves to an empty array.
136131 */
137132 async refresh ( ) : Promise < IterableInboxRowViewModel [ ] > {
138- return RNIterableAPI . getInboxMessages ( ) . then (
133+ return IterableApi . getInboxMessages ( ) . then (
139134 ( messages : IterableInAppMessage [ ] ) => {
140135 return this . processMessages ( messages ) ;
141136 } ,
@@ -151,7 +146,7 @@ export class IterableInboxDataModel {
151146 * @param visibleRows - An array of `IterableInboxImpressionRowInfo` objects representing the rows that are currently visible.
152147 */
153148 startSession ( visibleRows : IterableInboxImpressionRowInfo [ ] = [ ] ) {
154- RNIterableAPI . startSession ( visibleRows as unknown as { [ key : string ] : string | number | boolean } [ ] ) ;
149+ return IterableApi . startSession ( visibleRows ) ;
155150 }
156151
157152 /**
@@ -162,7 +157,7 @@ export class IterableInboxDataModel {
162157 */
163158 async endSession ( visibleRows : IterableInboxImpressionRowInfo [ ] = [ ] ) {
164159 await this . updateVisibleRows ( visibleRows ) ;
165- RNIterableAPI . endSession ( ) ;
160+ return IterableApi . endSession ( ) ;
166161 }
167162
168163 /**
@@ -178,7 +173,7 @@ export class IterableInboxDataModel {
178173 * Defaults to an empty array if not provided.
179174 */
180175 updateVisibleRows ( visibleRows : IterableInboxImpressionRowInfo [ ] = [ ] ) {
181- RNIterableAPI . updateVisibleRows ( visibleRows as unknown as { [ key : string ] : string | number | boolean } [ ] ) ;
176+ return IterableApi . updateVisibleRows ( visibleRows ) ;
182177 }
183178
184179 /**
0 commit comments