File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import MainHelper from '../../shared/helpers/MainHelper' ;
22import { IdentityModelStore } from '../modelStores/IdentityModelStore' ;
33import { TrackEventOperation } from '../operations/TrackEventOperation' ;
4- import { ICustomEvent , ICustomEventController } from '../types/customEvents' ;
5- import { IOperationRepo } from '../types/operation' ;
4+ import type {
5+ ICustomEvent ,
6+ ICustomEventController ,
7+ } from '../types/customEvents' ;
8+ import type { IOperationRepo } from '../types/operation' ;
69
710/**
811 * Implements custom event tracking functionality.
912 * This class handles sending custom events by creating TrackEventOperation instances
1013 * and enqueueing them for execution via the operation repository.
1114 */
1215export class CustomEventController implements ICustomEventController {
13- constructor (
14- private readonly _identityModelStore : IdentityModelStore ,
15- private readonly _opRepo : IOperationRepo ,
16- ) { }
16+ private readonly _identityModelStore : IdentityModelStore ;
17+ private readonly _opRepo : IOperationRepo ;
18+
19+ constructor ( identityModelStore : IdentityModelStore , opRepo : IOperationRepo ) {
20+ this . _identityModelStore = identityModelStore ;
21+ this . _opRepo = opRepo ;
22+ }
1723
1824 sendCustomEvent ( event : ICustomEvent ) : void {
1925 const appId = MainHelper . getAppId ( ) ;
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ import { ExecutionResponse } from '../operations/ExecutionResponse';
1010import { Operation } from '../operations/Operation' ;
1111import { TrackEventOperation } from '../operations/TrackEventOperation' ;
1212import { RequestService } from '../requestService/RequestService' ;
13- import { ICustomEventMetadata } from '../types/customEvents' ;
14- import { ExecutionResult , IOperationExecutor } from '../types/operation' ;
13+ import type { ICustomEventMetadata } from '../types/customEvents' ;
14+ import { ExecutionResult , type IOperationExecutor } from '../types/operation' ;
1515
1616// Implements logic similar to Android SDK's CustomEventOperationExecutor
1717// Reference: https://github.com/OneSignal/OneSignal-Android-SDK/blob/main/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/operations/impl/executors/CustomEventOperationExecutor.kt
Original file line number Diff line number Diff line change 22// Reference: https://github.com/OneSignal/OneSignal-Android-SDK/blob/5.1.31/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/modeling/ModelStore.kt
33import {
44 type DatabaseModel ,
5+ type IEventNotifier ,
56 type IModelStore ,
67 type IModelStoreChangeHandler ,
78 ModelChangeTags ,
Original file line number Diff line number Diff line change 11import Environment from 'src/shared/helpers/Environment' ;
2- import { ISubscription } from '../types/api' ;
2+ import type { ISubscription } from '../types/api' ;
33import {
44 type NotificationTypeValue ,
55 type SubscriptionTypeValue ,
Original file line number Diff line number Diff line change 11import Environment from 'src/shared/helpers/Environment' ;
2- import { ICreateUserSubscription } from '../types/api' ;
2+ import type { ICreateUserSubscription } from '../types/api' ;
33import {
44 type NotificationTypeValue ,
55 type SubscriptionTypeValue ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
1717 type RequestMetadata ,
1818 type UserData ,
1919} from '../types/api' ;
20- import { ICreateEvent } from '../types/customEvents' ;
20+ import type { ICreateEvent } from '../types/customEvents' ;
2121import AliasPair from './AliasPair' ;
2222
2323export class RequestService {
Original file line number Diff line number Diff line change 1- import { SubscriptionTypeValue } from './subscription' ;
1+ import type { SubscriptionTypeValue } from './subscription' ;
22
33export interface ICustomEvent {
44 name : string ;
Original file line number Diff line number Diff line change @@ -2,18 +2,10 @@ import type {
22 NotificationTypeValue ,
33 SubscriptionTypeValue ,
44} from 'src/core/types/subscription' ;
5- import {
6- NotificationType ,
7- NotificationTypeValue ,
8- SubscriptionTypeValue ,
9- } from 'src/core/types/subscription' ;
10- import {
11- useSafariLegacyPush ,
12- useSafariVapidPush ,
13- } from 'src/shared/environment' ;
5+ import { NotificationType } from 'src/core/types/subscription' ;
146import { RawPushSubscription } from 'src/shared/models/RawPushSubscription' ;
157import Environment from '../../shared/helpers/Environment' ;
16- import { Serializable } from '../models/Serializable' ;
8+ import type { Serializable } from '../models/Serializable' ;
179
1810export default class FuturePushSubscriptionRecord implements Serializable {
1911 readonly type : SubscriptionTypeValue ;
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import type { IUpdateUser } from 'src/core/types/api';
22import { NotificationType } from 'src/core/types/subscription' ;
33import AliasPair from '../../core/requestService/AliasPair' ;
44import { RequestService } from '../../core/requestService/RequestService' ;
5- import { OutcomeRequestData } from '../../page/models/OutcomeRequestData' ;
5+ import type { OutcomeRequestData } from '../../page/models/OutcomeRequestData' ;
66import Utils from '../context/Utils' ;
77import Environment from '../helpers/Environment' ;
88import Log from '../libraries/Log' ;
9+ import type { ServerAppConfig } from '../models/AppConfig' ;
910import type { DeliveryPlatformKindValue } from '../models/DeliveryPlatformKind' ;
1011import {
1112 OutcomeAttributionType ,
Original file line number Diff line number Diff line change 88import { RawPushSubscription } from '../../../src/shared/models/RawPushSubscription' ;
99import { Utils } from '../../shared/context/Utils' ;
1010import ServiceWorkerHelper from '../../shared/helpers/ServiceWorkerHelper' ;
11- import ContextSW from '../../shared/models/ContextSW' ;
1211import {
1312 type NotificationClickEventInternal ,
1413 type NotificationForegroundWillDisplayEventSerializable ,
@@ -41,9 +40,8 @@ import {
4140 NotificationType ,
4241 type NotificationTypeValue ,
4342} from 'src/core/types/subscription' ;
44- import { type AppConfig , getServerAppConfig } from 'src/shared/config ' ;
43+ import type { AppConfig } from 'src/shared/models/AppConfig ' ;
4544import type { DeliveryPlatformKindValue } from 'src/shared/models/DeliveryPlatformKind' ;
46- import { VERSION } from 'src/shared/utils/EnvVariables' ;
4745import { bowserCastle } from '../../shared/utils/bowserCastle' ;
4846import { ModelCacheDirectAccess } from '../helpers/ModelCacheDirectAccess' ;
4947import { OSNotificationButtonsConverter } from '../models/OSNotificationButtonsConverter' ;
You can’t perform that action at this time.
0 commit comments