File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import { SetPropertyOperation } from '../operations/SetPropertyOperation';
1212import { SetTagOperation } from '../operations/SetTagOperation' ;
1313import { TrackSessionEndOperation } from '../operations/TrackSessionEndOperation' ;
1414import { TrackSessionStartOperation } from '../operations/TrackSessionStartOperation' ;
15+ import { TransferSubscriptionOperation } from '../operations/TransferSubscriptionOperation' ;
1516import { UpdateSubscriptionOperation } from '../operations/UpdateSubscriptionOperation' ;
1617import { ModelStore } from './ModelStore' ;
1718
@@ -54,6 +55,9 @@ export class OperationModelStore extends ModelStore<Operation> {
5455 case OPERATION_NAME . DELETE_SUBSCRIPTION :
5556 operation = new DeleteSubscriptionOperation ( ) ;
5657 break ;
58+ case OPERATION_NAME . TRANSFER_SUBSCRIPTION :
59+ operation = new TransferSubscriptionOperation ( ) ;
60+ break ;
5761 case OPERATION_NAME . REFRESH_USER :
5862 operation = new RefreshUserOperation ( ) ;
5963 break ;
Original file line number Diff line number Diff line change 1+ import { OPERATION_NAME } from '../executors/constants' ;
2+ import { BaseSubscriptionOperation } from './BaseSubscriptionOperation' ;
3+ import { GroupComparisonType , GroupComparisonValue } from './Operation' ;
4+
5+ /**
6+ * An Operation to transfer a subscription to a new owner on the OneSignal backend.
7+ */
8+ export class TransferSubscriptionOperation extends BaseSubscriptionOperation {
9+ constructor ( appId ?: string , onesignalId ?: string , subscriptionId ?: string ) {
10+ super ( OPERATION_NAME . TRANSFER_SUBSCRIPTION , appId , onesignalId ) ;
11+ if ( subscriptionId ) {
12+ this . subscriptionId = subscriptionId ;
13+ }
14+ }
15+
16+ override get groupComparisonType ( ) : GroupComparisonValue {
17+ return GroupComparisonType . NONE ;
18+ }
19+
20+ override get modifyComparisonKey ( ) : string {
21+ return `${ this . appId } .Subscription.${ this . subscriptionId } .Transfer` ;
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments